aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcampbeb <bpcampbell@gmail.com>2013-06-13 22:57:53 -1000
committercampbeb <bpcampbell@gmail.com>2013-06-13 22:57:53 -1000
commit947df888d1b90c24a5c0d18d0ed9a2eed73868ab (patch)
treee27f5504e95c5d5769e60c8467586fe9f0b86c9e
parent76f59b8a23b64ac737259f57319c87b3016d80a7 (diff)
downloadcgeo-947df888d1b90c24a5c0d18d0ed9a2eed73868ab.zip
cgeo-947df888d1b90c24a5c0d18d0ed9a2eed73868ab.tar.gz
cgeo-947df888d1b90c24a5c0d18d0ed9a2eed73868ab.tar.bz2
Fix #2882 - Clear offline log through cache object
Go through cache object instead of directly to cgData so change notifications can be made
-rw-r--r--main/src/cgeo/geocaching/Geocache.java5
-rw-r--r--main/src/cgeo/geocaching/LogCacheActivity.java4
-rw-r--r--main/src/cgeo/geocaching/ui/LoggingUI.java2
3 files changed, 8 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java
index 781f9ff..1972c7a 100644
--- a/main/src/cgeo/geocaching/Geocache.java
+++ b/main/src/cgeo/geocaching/Geocache.java
@@ -490,6 +490,11 @@ public class Geocache implements ICache, IWaypoint {
}
}
+ public void clearOfflineLog() {
+ cgData.clearLogOffline(geocode);
+ notifyChange();
+ }
+
public List<LogType> getPossibleLogTypes() {
final List<LogType> logTypes = new ArrayList<LogType>();
if (isEventCache()) {
diff --git a/main/src/cgeo/geocaching/LogCacheActivity.java b/main/src/cgeo/geocaching/LogCacheActivity.java
index e4d3d17..62c94ce 100644
--- a/main/src/cgeo/geocaching/LogCacheActivity.java
+++ b/main/src/cgeo/geocaching/LogCacheActivity.java
@@ -368,7 +368,7 @@ public class LogCacheActivity extends AbstractLoggingActivity implements DateDia
}
private void clearLog() {
- cgData.clearLogOffline(geocode);
+ cache.clearOfflineLog();
setDefaultValues();
@@ -533,7 +533,7 @@ public class LogCacheActivity extends AbstractLoggingActivity implements DateDia
}
cgData.saveChangedCache(cache);
- cgData.clearLogOffline(geocode);
+ cache.clearOfflineLog();
if (typeSelected == LogType.FOUND_IT) {
if (tweetCheck.isChecked() && tweetBox.getVisibility() == View.VISIBLE) {
diff --git a/main/src/cgeo/geocaching/ui/LoggingUI.java b/main/src/cgeo/geocaching/ui/LoggingUI.java
index 1ba15a2..ac74dd3 100644
--- a/main/src/cgeo/geocaching/ui/LoggingUI.java
+++ b/main/src/cgeo/geocaching/ui/LoggingUI.java
@@ -104,7 +104,7 @@ public class LoggingUI extends AbstractUIFactory {
break;
case CLEAR_LOG:
- cgData.clearLogOffline(cache.getGeocode());
+ cache.clearOfflineLog();
break;
}
} else {