diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2011-11-23 08:09:00 +0100 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2011-11-23 08:09:00 +0100 |
commit | d86925ca0efc051259a35f917753080868614f0f (patch) | |
tree | 9e4828f054123b57d130eed57e421c1cc9911287 /main/src/cgeo/geocaching/Settings.java | |
parent | 924af5f8ad2afa2f7ef2d69599944e7bf6b71a9c (diff) | |
parent | 4226ec4247f122a875539c55fcb147a81bce5780 (diff) | |
download | cgeo-d86925ca0efc051259a35f917753080868614f0f.zip cgeo-d86925ca0efc051259a35f917753080868614f0f.tar.gz cgeo-d86925ca0efc051259a35f917753080868614f0f.tar.bz2 |
Merge remote branch 'blafoo/cachetype'
Conflicts:
main/src/cgeo/geocaching/cgBase.java
main/src/cgeo/geocaching/cgeocaches.java
main/src/cgeo/geocaching/filter/cgFilterByType.java
main/src/cgeo/geocaching/maps/CachesOverlay.java
Diffstat (limited to 'main/src/cgeo/geocaching/Settings.java')
-rw-r--r-- | main/src/cgeo/geocaching/Settings.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/main/src/cgeo/geocaching/Settings.java b/main/src/cgeo/geocaching/Settings.java index 4d0fb01..aa5b659 100644 --- a/main/src/cgeo/geocaching/Settings.java +++ b/main/src/cgeo/geocaching/Settings.java @@ -249,7 +249,11 @@ public final class Settings { return sharedPrefs.getString(KEY_COOKIE_STORE, null); } - public static CacheType setCacheType(final CacheType cacheType) { + /** + * @param cacheType + * The cache type used for future filtering + */ + public static void setCacheType(final CacheType cacheType) { editSharedSettings(new PrefRunnable() { @Override public void edit(Editor edit) { @@ -260,7 +264,6 @@ public final class Settings { } } }); - return cacheType; } public static void setLiveMap(final boolean live) { @@ -779,12 +782,11 @@ public final class Settings { return sharedPrefs.getString(KEY_WEBDEVICE_NAME, null); } + /** + * @return The cache type used for filtering or ALL if no filter is active. Returns never null + */ public static CacheType getCacheType() { - String cacheFilterType = sharedPrefs.getString(KEY_CACHE_TYPE, null); - if (cacheFilterType == null) { - return null; - } - return CacheType.getById(cacheFilterType); + return CacheType.getById(sharedPrefs.getString(KEY_CACHE_TYPE, CacheType.ALL.id)); } public static int getWayPointsThreshold() { |