diff options
Diffstat (limited to 'main/src/cgeo/geocaching/LogEntry.java')
| -rw-r--r-- | main/src/cgeo/geocaching/LogEntry.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/main/src/cgeo/geocaching/LogEntry.java b/main/src/cgeo/geocaching/LogEntry.java index b625bb5..df1038f 100644 --- a/main/src/cgeo/geocaching/LogEntry.java +++ b/main/src/cgeo/geocaching/LogEntry.java @@ -2,6 +2,7 @@ package cgeo.geocaching; import cgeo.geocaching.enumerations.LogType; import cgeo.geocaching.utils.DateUtils; +import cgeo.geocaching.utils.MatcherWrapper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -10,7 +11,6 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.List; -import java.util.regex.Matcher; import java.util.regex.Pattern; public final class LogEntry { @@ -25,7 +25,7 @@ public final class LogEntry { public int found = -1; /** Friend's log entry */ public boolean friend = false; - private List<cgImage> logImages = null; + private List<Image> logImages = null; public String cacheName = ""; // used for trackables public String cacheGuid = ""; // used for trackables @@ -64,9 +64,9 @@ public final class LogEntry { log.compareTo(otherLog.log) == 0; } - public void addLogImage(final cgImage image) { + public void addLogImage(final Image image) { if (logImages == null) { - logImages = new ArrayList<cgImage>(); + logImages = new ArrayList<Image>(); } logImages.add(image); } @@ -74,7 +74,7 @@ public final class LogEntry { /** * @return the log images or an empty list, never <code>null</code> */ - public List<cgImage> getLogImages() { + public List<Image> getLogImages() { if (logImages == null) { return Collections.emptyList(); } @@ -87,7 +87,7 @@ public final class LogEntry { public CharSequence getImageTitles() { final List<String> titles = new ArrayList<String>(5); - for (cgImage image : getLogImages()) { + for (Image image : getLogImages()) { if (StringUtils.isNotBlank(image.getTitle())) { titles.add(image.getTitle()); } @@ -107,9 +107,13 @@ public final class LogEntry { */ public String getDisplayText() { if (Settings.getPlainLogs()) { - Matcher matcher = PATTERN_REMOVE_COLORS.matcher(log); + MatcherWrapper matcher = new MatcherWrapper(PATTERN_REMOVE_COLORS, log); return matcher.replaceAll(""); } return log; } + + public boolean isOwn() { + return author.equalsIgnoreCase(Settings.getUsername()); + } } |
