From a66a4bb132080908087a233dd6991f2df1b2640f Mon Sep 17 00:00:00 2001 From: blafoo Date: Mon, 17 Oct 2011 22:04:10 +0200 Subject: Get ratings only if the user wants additional details --- main/src/cgeo/geocaching/cgBase.java | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'main/src/cgeo/geocaching/cgBase.java') diff --git a/main/src/cgeo/geocaching/cgBase.java b/main/src/cgeo/geocaching/cgBase.java index 899f806..1988f60 100644 --- a/main/src/cgeo/geocaching/cgBase.java +++ b/main/src/cgeo/geocaching/cgBase.java @@ -939,27 +939,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 ratings = GCVote.getRating(guids, null); + try { + final Map 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()); } } -- cgit v1.1