aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblafoo <github@blafoo.de>2012-03-15 22:29:25 +0100
committerblafoo <github@blafoo.de>2012-03-15 22:29:25 +0100
commitb0000d071d0ec7fba47b7575f214cf7f7445b72b (patch)
tree2c9636c03aa5fe3ce87cbab98f96eb8e39f83913
parent1bef9d243203f789dd0eb328ba1ce1a445b721cf (diff)
downloadcgeo-b0000d071d0ec7fba47b7575f214cf7f7445b72b.zip
cgeo-b0000d071d0ec7fba47b7575f214cf7f7445b72b.tar.gz
cgeo-b0000d071d0ec7fba47b7575f214cf7f7445b72b.tar.bz2
Set cache as reliable only after downloading coords. Fixes #1285
-rw-r--r--main/src/cgeo/geocaching/cgBase.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/cgBase.java b/main/src/cgeo/geocaching/cgBase.java
index 91c61c0..0023499 100644
--- a/main/src/cgeo/geocaching/cgBase.java
+++ b/main/src/cgeo/geocaching/cgBase.java
@@ -293,9 +293,6 @@ public class cgBase {
}
}
- // location is reliable because the search return correct coordinates independent of the login status
- cache.setReliableLatLon(true);
-
searchResult.addCache(cache);
}
@@ -357,6 +354,11 @@ public class cgBase {
}
LocParser.parseLoc(searchResult, coordinates);
+
+ // now we have the coords...
+ for (cgCache cache : searchResult.getCachesFromSearchResult(LoadFlags.LOAD_CACHE_OR_DB)) {
+ cache.setReliableLatLon(true);
+ }
} catch (Exception e) {
Log.e(Settings.tag, "cgBase.parseSearch.CIDs: " + e.toString());
}
@@ -364,7 +366,7 @@ public class cgBase {
// get direction images
if (Settings.getLoadDirImg()) {
- final Set<cgCache> caches = cgeoapplication.getInstance().loadCaches(searchResult.getGeocodes(), LoadFlags.LOAD_CACHE_OR_DB);
+ final Set<cgCache> caches = searchResult.getCachesFromSearchResult(LoadFlags.LOAD_CACHE_OR_DB);
for (cgCache cache : caches) {
if (cache.getCoords() == null && StringUtils.isNotEmpty(cache.getDirectionImg())) {
DirectionImage.getDrawable(cache.getGeocode(), cache.getDirectionImg());