diff options
| author | Michael Keppler <michael.keppler@gmx.de> | 2014-04-22 11:03:23 +0200 |
|---|---|---|
| committer | Michael Keppler <michael.keppler@gmx.de> | 2014-04-22 11:03:23 +0200 |
| commit | 0e1262604f3a06469724b334a6f6268414e91fb8 (patch) | |
| tree | 63e1b22e5dc4e9f5f76d1c29deda6fd01719463f /main/src/cgeo/geocaching/Geocache.java | |
| parent | 8589d41a6a84c33bf0a4d6752483928aa3e5df67 (diff) | |
| download | cgeo-0e1262604f3a06469724b334a6f6268414e91fb8.zip cgeo-0e1262604f3a06469724b334a6f6268414e91fb8.tar.gz cgeo-0e1262604f3a06469724b334a6f6268414e91fb8.tar.bz2 | |
fix #3697: have attended as log type on day of event
Diffstat (limited to 'main/src/cgeo/geocaching/Geocache.java')
| -rw-r--r-- | main/src/cgeo/geocaching/Geocache.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index fa25576..1ed699e 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -25,6 +25,7 @@ import cgeo.geocaching.list.StoredList; import cgeo.geocaching.network.HtmlImage; import cgeo.geocaching.settings.Settings; import cgeo.geocaching.utils.CancellableHandler; +import cgeo.geocaching.utils.DateUtils; import cgeo.geocaching.utils.ImageUtils; import cgeo.geocaching.utils.LazyInitializedList; import cgeo.geocaching.utils.Log; @@ -1808,4 +1809,23 @@ public class Geocache implements ICache, IWaypoint { return (getType().applyDistanceRule() || hasUserModifiedCoords()) && getConnector() == GCConnector.getInstance(); } + public LogType getDefaultLogType() { + if (isEventCache()) { + final Date eventDate = getHiddenDate(); + boolean expired = DateUtils.isPastEvent(this); + + if (hasOwnLog(LogType.WILL_ATTEND) || expired || (eventDate != null && DateUtils.daysSince(eventDate.getTime()) == 0)) { + return hasOwnLog(LogType.ATTENDED) ? LogType.NOTE : LogType.ATTENDED; + } + return LogType.WILL_ATTEND; + } + if (isFound()) { + return LogType.NOTE; + } + if (getType() == CacheType.WEBCAM) { + return LogType.WEBCAM_PHOTO_TAKEN; + } + return LogType.FOUND_IT; + } + } |
