diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2011-10-16 08:39:57 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2011-10-16 08:39:57 +0200 |
| commit | bdf2f092c306274527f0f0f5aed4196a92dd0ca6 (patch) | |
| tree | 761ee524c08c331b52e571adf4ffa06fc1d8565e /main/src/cgeo/geocaching/cgCache.java | |
| parent | 9715ae30450e02fcf731a06888ad832c1734e544 (diff) | |
| download | cgeo-bdf2f092c306274527f0f0f5aed4196a92dd0ca6.zip cgeo-bdf2f092c306274527f0f0f5aed4196a92dd0ca6.tar.gz cgeo-bdf2f092c306274527f0f0f5aed4196a92dd0ca6.tar.bz2 | |
support cache type "unknown", fixes #518
* refactored many places to reference the cache type enum
* special icon for "unknown" still missing
Diffstat (limited to 'main/src/cgeo/geocaching/cgCache.java')
| -rw-r--r-- | main/src/cgeo/geocaching/cgCache.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java index 3f18628..8874eae 100644 --- a/main/src/cgeo/geocaching/cgCache.java +++ b/main/src/cgeo/geocaching/cgCache.java @@ -4,6 +4,7 @@ import cgeo.geocaching.activity.IAbstractActivity; import cgeo.geocaching.connector.ConnectorFactory; import cgeo.geocaching.connector.IConnector; import cgeo.geocaching.enumerations.CacheSize; +import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.geopoint.Geopoint; import org.apache.commons.collections.CollectionUtils; @@ -262,7 +263,8 @@ public class cgCache implements ICache { } public boolean isEventCache() { - return "event".equalsIgnoreCase(type) || "mega".equalsIgnoreCase(type) || "cito".equalsIgnoreCase(type); + return CacheType.EVENT.id.equalsIgnoreCase(type) || CacheType.MEGA_EVENT.id.equalsIgnoreCase(type) + || CacheType.CITO.id.equalsIgnoreCase(type) || CacheType.LOSTANDFOUND.id.equalsIgnoreCase(type); } public boolean logVisit(IAbstractActivity fromActivity) { @@ -309,7 +311,7 @@ public class cgCache implements ICache { public List<Integer> getPossibleLogTypes() { boolean isOwner = owner != null && owner.equalsIgnoreCase(Settings.getUsername()); List<Integer> types = new ArrayList<Integer>(); - if ("event".equals(type) || "mega".equals(type) || "cito".equals(type) || "lostfound".equals(type)) { + if (isEventCache()) { types.add(cgBase.LOG_WILL_ATTEND); types.add(cgBase.LOG_NOTE); types.add(cgBase.LOG_ATTENDED); @@ -317,7 +319,7 @@ public class cgCache implements ICache { if (isOwner) { types.add(cgBase.LOG_ANNOUNCEMENT); } - } else if ("webcam".equals(type)) { + } else if (CacheType.WEBCAM.id.equals(type)) { types.add(cgBase.LOG_WEBCAM_PHOTO_TAKEN); types.add(cgBase.LOG_DIDNT_FIND_IT); types.add(cgBase.LOG_NOTE); |
