diff options
| author | Marco Jacob <mjacob@union06.de> | 2013-05-27 12:45:11 -0700 |
|---|---|---|
| committer | Marco Jacob <mjacob@union06.de> | 2013-05-27 12:45:11 -0700 |
| commit | a47d0ebf2f0efeabe73ea0d313ea2e5c0e93d25c (patch) | |
| tree | 4c9a3699fac4c424871cca269dab07e36e1a1c0d /main/src | |
| parent | 29bcd5b110a0f153ce00bb0df536f0813cbb0c2a (diff) | |
| parent | 90ab88a43a124368cdef5e766f7e028e38848158 (diff) | |
| download | cgeo-a47d0ebf2f0efeabe73ea0d313ea2e5c0e93d25c.zip cgeo-a47d0ebf2f0efeabe73ea0d313ea2e5c0e93d25c.tar.gz cgeo-a47d0ebf2f0efeabe73ea0d313ea2e5c0e93d25c.tar.bz2 | |
Merge pull request #2790 from marco-jacob/cacheRefreshMergeIssue
fixes #2771 - parsed cache from GCParser should be detailed before adding
Diffstat (limited to 'main/src')
| -rw-r--r-- | main/src/cgeo/geocaching/Geocache.java | 8 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/connector/gc/GCParser.java | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index 5286d1c..304f940 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -175,7 +175,9 @@ public class Geocache implements ICache, IWaypoint { } /** - * Gather missing information from another cache object. + * Gather missing information for new Geocache object from the stored Geocache object. + * This is called in the new Geocache parsed from website to set information not yet + * parsed. * * @param other * the other version, or null if non-existent @@ -187,6 +189,8 @@ public class Geocache implements ICache, IWaypoint { } updated = System.currentTimeMillis(); + // if parsed cache is not yet detailed and stored is, the information of + // the parsed cache will be overwritten if (!detailed && (other.detailed || zoomlevel < other.zoomlevel)) { detailed = other.detailed; detailedUpdate = other.detailedUpdate; @@ -206,7 +210,7 @@ public class Geocache implements ICache, IWaypoint { onWatchlist = other.onWatchlist; logOffline = other.logOffline; finalDefined = other.finalDefined; - // archived is kept from the most recent data + archived = other.archived; } /* diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java index 3334c42..659f0d0 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCParser.java +++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java @@ -330,9 +330,11 @@ public abstract class GCParser { static SearchResult parseCache(final String page, final CancellableHandler handler) { final SearchResult searchResult = parseCacheFromText(page, handler); + // attention: parseCacheFromText already stores implicitely through searchResult.addCache if (searchResult != null && !searchResult.getGeocodes().isEmpty()) { final Geocache cache = searchResult.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB); getExtraOnlineInfo(cache, page, handler); + // too late: it is already stored through parseCacheFromText cache.setDetailedUpdatedNow(); if (CancellableHandler.isCancelled(handler)) { return null; @@ -726,6 +728,7 @@ public abstract class GCParser { return searchResult; } + cache.setDetailedUpdatedNow(); searchResult.addCache(cache); return searchResult; } |
