diff options
Diffstat (limited to 'main/src/cgeo/geocaching/settings/Settings.java')
| -rw-r--r-- | main/src/cgeo/geocaching/settings/Settings.java | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/main/src/cgeo/geocaching/settings/Settings.java b/main/src/cgeo/geocaching/settings/Settings.java index aaaf64a..d93f83f 100644 --- a/main/src/cgeo/geocaching/settings/Settings.java +++ b/main/src/cgeo/geocaching/settings/Settings.java @@ -13,7 +13,7 @@ import cgeo.geocaching.enumerations.LogType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.list.StoredList; import cgeo.geocaching.maps.MapProviderFactory; -import cgeo.geocaching.maps.google.v1.GoogleMapProvider; +//import cgeo.geocaching.maps.google.v1.GoogleMapProvider; import cgeo.geocaching.maps.interfaces.GeoPointImpl; import cgeo.geocaching.maps.interfaces.MapProvider; import cgeo.geocaching.maps.interfaces.MapSource; @@ -52,7 +52,7 @@ public class Settings { private static final char HISTORY_SEPARATOR = ','; public static final int SHOW_WP_THRESHOLD_DEFAULT = 10; public static final int SHOW_WP_THRESHOLD_MAX = 50; - private static final int MAP_SOURCE_DEFAULT = GoogleMapProvider.GOOGLE_MAP_ID.hashCode(); +// private static final int MAP_SOURCE_DEFAULT = GoogleMapProvider.GOOGLE_MAP_ID.hashCode(); public static final boolean HW_ACCEL_DISABLED_BY_DEFAULT = Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || @@ -126,7 +126,7 @@ public class Settings { e.putString(getKey(R.string.pref_webDeviceCode), old.getString(getKey(R.string.pref_webDeviceCode), null)); e.putString(getKey(R.string.pref_webDeviceName), old.getString(getKey(R.string.pref_webDeviceName), null)); e.putBoolean(getKey(R.string.pref_maplive), old.getInt(getKey(R.string.pref_maplive), 1) != 0); - e.putInt(getKey(R.string.pref_mapsource), old.getInt(getKey(R.string.pref_mapsource), MAP_SOURCE_DEFAULT)); +// e.putInt(getKey(R.string.pref_mapsource), old.getInt(getKey(R.string.pref_mapsource), MAP_SOURCE_DEFAULT)); e.putBoolean(getKey(R.string.pref_twitter), 0 != old.getInt(getKey(R.string.pref_twitter), 0)); e.putBoolean(getKey(R.string.pref_showaddress), 0 != old.getInt(getKey(R.string.pref_showaddress), 1)); e.putBoolean(getKey(R.string.pref_showcaptcha), old.getBoolean(getKey(R.string.pref_showcaptcha), false)); @@ -192,9 +192,9 @@ public class Settings { e.putInt(getKey(R.string.pref_showwaypointsthreshold), wpThreshold); // KEY_MAP_SOURCE must be string, because it is the key for a ListPreference now - final int ms = sharedPrefs.getInt(getKey(R.string.pref_mapsource), MAP_SOURCE_DEFAULT); +// final int ms = sharedPrefs.getInt(getKey(R.string.pref_mapsource), MAP_SOURCE_DEFAULT); e.remove(getKey(R.string.pref_mapsource)); - e.putString(getKey(R.string.pref_mapsource), String.valueOf(ms)); +// e.putString(getKey(R.string.pref_mapsource), String.valueOf(ms)); // navigation tool ids must be string, because ListPreference uses strings as keys final int dnt1 = sharedPrefs.getInt(getKey(R.string.pref_defaultNavigationTool), NavigationAppsEnum.COMPASS.id); @@ -623,8 +623,8 @@ public class Settings { if (mapSource != null) { return mapSource; } - final int id = getConvertedMapId(); - mapSource = MapProviderFactory.getMapSource(id); +// final int id = getConvertedMapId(); +// mapSource = MapProviderFactory.getMapSource(id); if (mapSource != null) { // don't use offline maps if the map file is not valid if ((!(mapSource instanceof OfflineMapSource)) || (isValidMapFile())) { @@ -650,30 +650,30 @@ public class Settings { * * @return */ - private static int getConvertedMapId() { - final int id = Integer.parseInt(getString(R.string.pref_mapsource, - String.valueOf(MAP_SOURCE_DEFAULT))); - switch (id) { - case GOOGLEMAP_BASEID + MAP: - return GoogleMapProvider.GOOGLE_MAP_ID.hashCode(); - case GOOGLEMAP_BASEID + SATELLITE: - return GoogleMapProvider.GOOGLE_SATELLITE_ID.hashCode(); - case MFMAP_BASEID + MAPNIK: - return MapsforgeMapProvider.MAPSFORGE_MAPNIK_ID.hashCode(); - case MFMAP_BASEID + CYCLEMAP: - return MapsforgeMapProvider.MAPSFORGE_CYCLEMAP_ID.hashCode(); - case MFMAP_BASEID + OFFLINE: { - final String mapFile = Settings.getMapFile(); - if (StringUtils.isNotEmpty(mapFile)) { - return mapFile.hashCode(); - } - break; - } - default: - break; - } - return id; - } +// private static int getConvertedMapId() { +// final int id = Integer.parseInt(getString(R.string.pref_mapsource, +// String.valueOf(MAP_SOURCE_DEFAULT))); +// switch (id) { +// case GOOGLEMAP_BASEID + MAP: +// return GoogleMapProvider.GOOGLE_MAP_ID.hashCode(); +// case GOOGLEMAP_BASEID + SATELLITE: +// return GoogleMapProvider.GOOGLE_SATELLITE_ID.hashCode(); +// case MFMAP_BASEID + MAPNIK: +// return MapsforgeMapProvider.MAPSFORGE_MAPNIK_ID.hashCode(); +// case MFMAP_BASEID + CYCLEMAP: +// return MapsforgeMapProvider.MAPSFORGE_CYCLEMAP_ID.hashCode(); +// case MFMAP_BASEID + OFFLINE: { +// final String mapFile = Settings.getMapFile(); +// if (StringUtils.isNotEmpty(mapFile)) { +// return mapFile.hashCode(); +// } +// break; +// } +// default: +// break; +// } +// return id; +// } public static void setMapSource(final MapSource newMapSource) { putString(R.string.pref_mapsource, String.valueOf(newMapSource.getNumericalId())); |
