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 | |
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')
-rw-r--r-- | main/src/cgeo/geocaching/activity/AbstractActivity.java | 2 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/activity/AbstractListActivity.java | 2 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/cgBase.java | 32 |
3 files changed, 17 insertions, 19 deletions
diff --git a/main/src/cgeo/geocaching/activity/AbstractActivity.java b/main/src/cgeo/geocaching/activity/AbstractActivity.java index 7c127e9..2b3aede 100644 --- a/main/src/cgeo/geocaching/activity/AbstractActivity.java +++ b/main/src/cgeo/geocaching/activity/AbstractActivity.java @@ -76,8 +76,6 @@ public abstract class AbstractActivity extends Activity implements IAbstractActi app = (cgeoapplication) this.getApplication(); prefs = getSharedPreferences(Settings.preferences, Context.MODE_PRIVATE); base = new cgBase(app); - - Settings.setLanguage(Settings.isUseEnglish()); } public void addVisitMenu(Menu menu, cgCache cache) { diff --git a/main/src/cgeo/geocaching/activity/AbstractListActivity.java b/main/src/cgeo/geocaching/activity/AbstractListActivity.java index 8984408..b947c2e 100644 --- a/main/src/cgeo/geocaching/activity/AbstractListActivity.java +++ b/main/src/cgeo/geocaching/activity/AbstractListActivity.java @@ -73,8 +73,6 @@ public abstract class AbstractListActivity extends ListActivity implements app = (cgeoapplication) this.getApplication(); prefs = getSharedPreferences(Settings.preferences, Context.MODE_PRIVATE); base = new cgBase(app); - - Settings.setLanguage(Settings.isUseEnglish()); } final public void setTitle(final String title) { 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()); } } |