aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/connector/ox/OXGPXParser.java14
-rw-r--r--main/src/cgeo/geocaching/files/GPXParser.java3
2 files changed, 17 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/connector/ox/OXGPXParser.java b/main/src/cgeo/geocaching/connector/ox/OXGPXParser.java
index f40a3e8..f72b698 100644
--- a/main/src/cgeo/geocaching/connector/ox/OXGPXParser.java
+++ b/main/src/cgeo/geocaching/connector/ox/OXGPXParser.java
@@ -3,6 +3,9 @@ package cgeo.geocaching.connector.ox;
import cgeo.geocaching.Geocache;
import cgeo.geocaching.files.GPX10Parser;
+import org.apache.commons.lang3.StringUtils;
+import org.eclipse.jdt.annotation.NonNull;
+
public class OXGPXParser extends GPX10Parser {
private final boolean isDetailed;
@@ -19,5 +22,16 @@ public class OXGPXParser extends GPX10Parser {
cache.setDetailedUpdate(cache.getUpdated());
cache.setDetailed(true);
}
+ removeTitleFromShortDescription(cache);
+ }
+
+ /**
+ * The short description of OX caches contains "title by owner, type(T/D/Awesomeness)". That is a lot of
+ * duplication.
+ *
+ * @param cache
+ */
+ private static void removeTitleFromShortDescription(final @NonNull Geocache cache) {
+ cache.setShortDescription(StringUtils.substringAfterLast(cache.getShortDescription(), ","));
}
}
diff --git a/main/src/cgeo/geocaching/files/GPXParser.java b/main/src/cgeo/geocaching/files/GPXParser.java
index 3341f95..d26a48c 100644
--- a/main/src/cgeo/geocaching/files/GPXParser.java
+++ b/main/src/cgeo/geocaching/files/GPXParser.java
@@ -856,6 +856,9 @@ public abstract class GPXParser extends FileParser {
}
/**
+ * Overwrite this method in a GPX parser sub class to modify the {@link Geocache}, after it has been fully parsed
+ * from the GPX file and before it gets stored.
+ *
* @param cache
* currently imported cache
*/