diff options
author | rsudev <rasch@munin-soft.de> | 2012-02-26 08:00:10 +0100 |
---|---|---|
committer | rsudev <rasch@munin-soft.de> | 2012-02-26 08:00:10 +0100 |
commit | 054cda3500b766846a3a5fc1e6d4f2788f5e5876 (patch) | |
tree | 5bfa9a90b8414ea4e4d78fbf27c6bd4cdaa3b4ae /main/src/cgeo/geocaching | |
parent | b16f78c829e5aaf36979ca83e3451fcec1b171ee (diff) | |
download | cgeo-054cda3500b766846a3a5fc1e6d4f2788f5e5876.zip cgeo-054cda3500b766846a3a5fc1e6d4f2788f5e5876.tar.gz cgeo-054cda3500b766846a3a5fc1e6d4f2788f5e5876.tar.bz2 |
Fixes #1163, refactor geocode usage in cgeowaypoint
- removed parameter and member, always taken from contained waypoint
Diffstat (limited to 'main/src/cgeo/geocaching')
-rw-r--r-- | main/src/cgeo/geocaching/cgeowaypoint.java | 15 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/maps/CachesOverlay.java | 1 |
2 files changed, 5 insertions, 11 deletions
diff --git a/main/src/cgeo/geocaching/cgeowaypoint.java b/main/src/cgeo/geocaching/cgeowaypoint.java index 7fbf14a..aac3005 100644 --- a/main/src/cgeo/geocaching/cgeowaypoint.java +++ b/main/src/cgeo/geocaching/cgeowaypoint.java @@ -32,7 +32,6 @@ public class cgeowaypoint extends AbstractActivity { private static final int MENU_ID_DEFAULT_NAVIGATION = 2; private static final int MENU_ID_OPEN_GEOCACHE = 6; private cgWaypoint waypoint = null; - private String geocode = null; private int id = -1; private ProgressDialog waitDialog = null; private cgGeo geo = null; @@ -147,7 +146,6 @@ public class cgeowaypoint extends AbstractActivity { // try to get data from extras if (extras != null) { id = extras.getInt("waypoint"); - geocode = extras.getString("geocode"); } if (id <= 0) { @@ -239,7 +237,7 @@ public class cgeowaypoint extends AbstractActivity { menu.findItem(MENU_ID_DEFAULT_NAVIGATION).setVisible(visible); menu.findItem(MENU_ID_CACHES_AROUND).setVisible(visible); - boolean openGeocache = StringUtils.isEmpty(geocode) && StringUtils.isNotEmpty(waypoint.getGeocode()); + boolean openGeocache = waypoint != null && StringUtils.isNotEmpty(waypoint.getGeocode()); menu.findItem(MENU_ID_OPEN_GEOCACHE).setVisible(openGeocache); } catch (Exception e) { // nothing @@ -322,13 +320,10 @@ public class cgeowaypoint extends AbstractActivity { public void onClick(View arg0) { if (app.deleteWaypoint(id)) { - String tmpCode = geocode; - if (StringUtils.isEmpty(tmpCode)) { - tmpCode = waypoint.getGeocode(); - } - StaticMapsProvider.removeWpStaticMaps(id, tmpCode); - if (!StringUtils.isEmpty(tmpCode)) { - app.removeCache(tmpCode, EnumSet.of(RemoveFlag.REMOVE_CACHE)); + String geocode = waypoint.getGeocode(); + StaticMapsProvider.removeWpStaticMaps(id, geocode); + if (!StringUtils.isEmpty(geocode)) { + app.removeCache(geocode, EnumSet.of(RemoveFlag.REMOVE_CACHE)); } finish(); diff --git a/main/src/cgeo/geocaching/maps/CachesOverlay.java b/main/src/cgeo/geocaching/maps/CachesOverlay.java index deda643..37ac3a5 100644 --- a/main/src/cgeo/geocaching/maps/CachesOverlay.java +++ b/main/src/cgeo/geocaching/maps/CachesOverlay.java @@ -212,7 +212,6 @@ public class CachesOverlay extends AbstractItemizedOverlay { Intent popupIntent = new Intent(context, cgeowaypoint.class); popupIntent.putExtra("waypoint", coordinate.getId()); - popupIntent.putExtra("geocode", coordinate.getGeocode()); context.startActivity(popupIntent); } else { |