diff options
Diffstat (limited to 'main/src/cgeo/geocaching/cgBase.java')
| -rw-r--r-- | main/src/cgeo/geocaching/cgBase.java | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/main/src/cgeo/geocaching/cgBase.java b/main/src/cgeo/geocaching/cgBase.java index 4f2553a..0cff355 100644 --- a/main/src/cgeo/geocaching/cgBase.java +++ b/main/src/cgeo/geocaching/cgBase.java @@ -884,27 +884,29 @@ public class cgBase { } } - // get ratings - if (guids.size() > 0) { - Log.i(Settings.tag, "Trying to get ratings for " + cids.size() + " caches"); + if (Settings.isAdditionalDetails()) { + // get ratings + if (guids.size() > 0) { + Log.i(Settings.tag, "Trying to get ratings for " + cids.size() + " caches"); - try { - final Map<String, cgRating> ratings = GCVote.getRating(guids, null); + try { + final Map<String, cgRating> ratings = GCVote.getRating(guids, null); - if (MapUtils.isNotEmpty(ratings)) { - // save found cache coordinates - for (cgCache oneCache : caches.cacheList) { - if (ratings.containsKey(oneCache.guid)) { - cgRating thisRating = ratings.get(oneCache.guid); + if (MapUtils.isNotEmpty(ratings)) { + // save found cache coordinates + for (cgCache oneCache : caches.cacheList) { + if (ratings.containsKey(oneCache.guid)) { + cgRating thisRating = ratings.get(oneCache.guid); - oneCache.rating = thisRating.rating; - oneCache.votes = thisRating.votes; - oneCache.myVote = thisRating.myVote; + oneCache.rating = thisRating.rating; + oneCache.votes = thisRating.votes; + oneCache.myVote = thisRating.myVote; + } } } + } catch (Exception e) { + Log.e(Settings.tag, "cgBase.parseSearch.GCvote: " + e.toString()); } - } catch (Exception e) { - Log.e(Settings.tag, "cgBase.parseSearch.GCvote: " + e.toString()); } } @@ -1439,23 +1441,26 @@ public class cgBase { sendLoadProgressDetail(handler, R.string.cache_dialog_loading_details_status_logs); loadLogsFromDetails(page, cache); - if (CancellableHandler.isCancelled(handler)) { - return; - } - sendLoadProgressDetail(handler, R.string.cache_dialog_loading_details_status_elevation); - if (cache.coords != null) { - cache.elevation = getElevation(cache.coords); - } + if (Settings.isAdditionalDetails()) { - if (CancellableHandler.isCancelled(handler)) { - return; - } - sendLoadProgressDetail(handler, R.string.cache_dialog_loading_details_status_gcvote); - final cgRating rating = GCVote.getRating(cache.guid, cache.geocode); - if (rating != null) { - cache.rating = rating.rating; - cache.votes = rating.votes; - cache.myVote = rating.myVote; + if (CancellableHandler.isCancelled(handler)) { + return; + } + sendLoadProgressDetail(handler, R.string.cache_dialog_loading_details_status_elevation); + if (cache.coords != null) { + cache.elevation = getElevation(cache.coords); + } + + if (CancellableHandler.isCancelled(handler)) { + return; + } + sendLoadProgressDetail(handler, R.string.cache_dialog_loading_details_status_gcvote); + final cgRating rating = GCVote.getRating(cache.guid, cache.geocode); + if (rating != null) { + cache.rating = rating.rating; + cache.votes = rating.votes; + cache.myVote = rating.myVote; + } } } |
