diff options
| -rw-r--r-- | src/cgeo/geocaching/cgBase.java | 13 | ||||
| -rw-r--r-- | src/cgeo/geocaching/cgeodetail.java | 7 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/cgeo/geocaching/cgBase.java b/src/cgeo/geocaching/cgBase.java index dbc2674..7e52d00 100644 --- a/src/cgeo/geocaching/cgBase.java +++ b/src/cgeo/geocaching/cgBase.java @@ -4677,12 +4677,15 @@ public class cgBase { public void storeCache(cgeoapplication app, Activity activity, cgCache cache, String geocode, int listId, Handler handler) { try { - // cache details + // get cache details, they may not yet be complete if (cache != null) { - final HashMap<String, String> params = new HashMap<String, String>(); - params.put("geocode", cache.geocode); - final Long searchId = searchByGeocode(params, listId, false); - cache = app.getCache(searchId); + // only reload the cache, if it was already stored or has not all details (by checking the description) + if (cache.reason > 0 || cache.description == null || cache.description.length() == 0) { + final HashMap<String, String> params = new HashMap<String, String>(); + params.put("geocode", cache.geocode); + final Long searchId = searchByGeocode(params, listId, false); + cache = app.getCache(searchId); + } } else if (geocode != null) { final HashMap<String, String> params = new HashMap<String, String>(); params.put("geocode", geocode); diff --git a/src/cgeo/geocaching/cgeodetail.java b/src/cgeo/geocaching/cgeodetail.java index e705141..1e88ab2 100644 --- a/src/cgeo/geocaching/cgeodetail.java +++ b/src/cgeo/geocaching/cgeodetail.java @@ -56,7 +56,7 @@ import cgeo.geocaching.apps.cache.navi.NavigationAppFactory; import cgeo.geocaching.compatibility.Compatibility; /** - * Activity to display all details of a cache like owner, difficulty, description etc. + * Activity to display all details of a cache like owner, difficulty, description etc. * */ public class cgeodetail extends AbstractActivity { @@ -1722,10 +1722,7 @@ public class cgeodetail extends AbstractActivity { @Override public void run() { - int reason = 1; - if (cache.reason > 1) { - reason = cache.reason; - } + int reason = (cache.reason > 1) ? cache.reason : 1; base.storeCache(app, cgeodetail.this, cache, null, reason, handler); } } |
