diff options
| author | blafoo <github@blafoo.de> | 2011-10-17 22:04:10 +0200 |
|---|---|---|
| committer | blafoo <github@blafoo.de> | 2011-10-22 20:28:34 +0200 |
| commit | a66a4bb132080908087a233dd6991f2df1b2640f (patch) | |
| tree | abb1c9cb4bfe3b58a4f91933d181fc8e94346f20 /main/src/cgeo/geocaching/cgBase.java | |
| parent | 6d6e123e432a509b879a27bb9d08f37d197ab5ec (diff) | |
| download | cgeo-a66a4bb132080908087a233dd6991f2df1b2640f.zip cgeo-a66a4bb132080908087a233dd6991f2df1b2640f.tar.gz cgeo-a66a4bb132080908087a233dd6991f2df1b2640f.tar.bz2 | |
Get ratings only if the user wants additional details
Diffstat (limited to 'main/src/cgeo/geocaching/cgBase.java')
| -rw-r--r-- | main/src/cgeo/geocaching/cgBase.java | 32 |
1 files changed, 17 insertions, 15 deletions
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<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()); } } |
