aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgCache.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2013-01-23 13:25:58 +0100
committerSamuel Tardieu <sam@rfc1149.net>2013-01-23 13:25:58 +0100
commiteb8c56ec7e19538a2b96b430e3a4e0c1c8fc179e (patch)
tree57b282849fb09aab0102a720b45b2bbc5384a34f /main/src/cgeo/geocaching/cgCache.java
parent60c81eb3e8c58802cd5dd918a0dec0a6c97c9109 (diff)
parent66aa9e5341c73819eb3c0e53330d4e8144f268e2 (diff)
downloadcgeo-eb8c56ec7e19538a2b96b430e3a4e0c1c8fc179e.zip
cgeo-eb8c56ec7e19538a2b96b430e3a4e0c1c8fc179e.tar.gz
cgeo-eb8c56ec7e19538a2b96b430e3a4e0c1c8fc179e.tar.bz2
Merge branch 'issue-2322' into upstream
Conflicts: main/src/cgeo/geocaching/connector/IConnector.java main/src/cgeo/geocaching/connector/gc/GCParser.java main/src/cgeo/geocaching/maps/CGeoMap.java
Diffstat (limited to 'main/src/cgeo/geocaching/cgCache.java')
-rw-r--r--main/src/cgeo/geocaching/cgCache.java19
1 files changed, 6 insertions, 13 deletions
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java
index 24bd66b..b120581 100644
--- a/main/src/cgeo/geocaching/cgCache.java
+++ b/main/src/cgeo/geocaching/cgCache.java
@@ -47,6 +47,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.EnumSet;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
@@ -88,7 +89,6 @@ public class cgCache implements ICache, IWaypoint {
private boolean premiumMembersOnly = false;
private boolean found = false;
private boolean favorite = false;
- private boolean own = false;
private int favoritePoints = 0;
private float rating = 0; // valid ratings are larger than zero
private int votes = 0;
@@ -187,7 +187,6 @@ public class cgCache implements ICache, IWaypoint {
reliableLatLon = other.reliableLatLon;
archived = other.archived;
found = other.found;
- own = other.own;
disabled = other.disabled;
favorite = other.favorite;
onWatchlist = other.onWatchlist;
@@ -352,7 +351,6 @@ public class cgCache implements ICache, IWaypoint {
cacheType == other.cacheType &&
size == other.size &&
found == other.found &&
- own == other.own &&
premiumMembersOnly == other.premiumMembersOnly &&
difficulty == other.difficulty &&
terrain == other.terrain &&
@@ -472,14 +470,13 @@ public class cgCache implements ICache, IWaypoint {
}
public List<LogType> getPossibleLogTypes() {
- boolean isOwner = getOwnerUserId() != null && getOwnerUserId().equalsIgnoreCase(Settings.getUsername());
- List<LogType> logTypes = new ArrayList<LogType>();
+ final List<LogType> logTypes = new LinkedList<LogType>();
if (isEventCache()) {
logTypes.add(LogType.WILL_ATTEND);
logTypes.add(LogType.NOTE);
logTypes.add(LogType.ATTENDED);
logTypes.add(LogType.NEEDS_ARCHIVE);
- if (isOwner) {
+ if (isOwner()) {
logTypes.add(LogType.ANNOUNCEMENT);
}
} else if (CacheType.WEBCAM == cacheType) {
@@ -495,7 +492,7 @@ public class cgCache implements ICache, IWaypoint {
logTypes.add(LogType.NEEDS_ARCHIVE);
logTypes.add(LogType.NEEDS_MAINTENANCE);
}
- if (isOwner) {
+ if (isOwner()) {
logTypes.add(LogType.OWNER_MAINTENANCE);
logTypes.add(LogType.TEMP_DISABLE_LISTING);
logTypes.add(LogType.ENABLE_LISTING);
@@ -593,8 +590,8 @@ public class cgCache implements ICache, IWaypoint {
}
@Override
- public boolean isOwn() {
- return own;
+ public boolean isOwner() {
+ return getConnector().isOwner(this);
}
@Override
@@ -1076,10 +1073,6 @@ public class cgCache implements ICache, IWaypoint {
this.found = found;
}
- public void setOwn(boolean own) {
- this.own = own;
- }
-
public void setAttributes(List<String> attributes) {
this.attributes.set(attributes);
}