diff options
| author | rsudev <rasch@munin-soft.de> | 2012-05-31 12:13:22 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2012-05-31 12:46:15 +0200 |
| commit | 452a8d10efabb873f780788350aba639d2abfdc5 (patch) | |
| tree | d554106cec0d51335e755cdefc6933259c303d43 | |
| parent | 8215d83677048ae773d07e8f3e001e581d906d81 (diff) | |
| download | cgeo-452a8d10efabb873f780788350aba639d2abfdc5.zip cgeo-452a8d10efabb873f780788350aba639d2abfdc5.tar.gz cgeo-452a8d10efabb873f780788350aba639d2abfdc5.tar.bz2 | |
Fix #1682: fix cache merge for not-detailed caches
| -rw-r--r-- | main/src/cgeo/geocaching/cgCache.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java index 72769f0..c765678 100644 --- a/main/src/cgeo/geocaching/cgCache.java +++ b/main/src/cgeo/geocaching/cgCache.java @@ -136,10 +136,12 @@ public class cgCache implements ICache, IWaypoint { } updated = System.currentTimeMillis(); - if (!detailed && other.detailed) { - detailed = true; + if (!detailed && (other.detailed || zoomlevel < other.zoomlevel)) { + detailed = other.detailed; detailedUpdate = other.detailedUpdate; coords = other.coords; + cacheType = other.cacheType; + zoomlevel = other.zoomlevel; // boolean values must be enumerated here. Other types are assigned outside this if-statement premiumMembersOnly = other.premiumMembersOnly; reliableLatLon = other.reliableLatLon; @@ -154,7 +156,8 @@ public class cgCache implements ICache, IWaypoint { } /* - * No gathering for boolean members if a cache is not-detailed + * No gathering for boolean members if other cache is not-detailed + * and does not have information with higher reliability (denoted by zoomlevel) * - found * - own * - disabled @@ -222,11 +225,6 @@ public class cgCache implements ICache, IWaypoint { if (coords == null) { coords = other.coords; } - if (zoomlevel < other.zoomlevel) { - zoomlevel = other.zoomlevel; - coords = other.coords; - } - if (elevation == null) { elevation = other.elevation; } |
