aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/Waypoint.java
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2014-12-13 15:43:42 +0100
committerrsudev <rasch@munin-soft.de>2014-12-13 15:43:42 +0100
commit1862cc60aee6035e237b1c2ec61d2fda03d305fe (patch)
tree7fc4876e351dc87fa76328264aa6bf389a5faf3d /main/src/cgeo/geocaching/Waypoint.java
parent997d57087cb079c85fea85575026a42c341a50b7 (diff)
downloadcgeo-1862cc60aee6035e237b1c2ec61d2fda03d305fe.zip
cgeo-1862cc60aee6035e237b1c2ec61d2fda03d305fe.tar.gz
cgeo-1862cc60aee6035e237b1c2ec61d2fda03d305fe.tar.bz2
Fixes #3797, Waypoints from personal note not removed
- make 'personal note' waypoints 'own' (allowing deletion by user) - never delete them automatically - changed place of note parsing to allow correct duplicate detection
Diffstat (limited to 'main/src/cgeo/geocaching/Waypoint.java')
-rw-r--r--main/src/cgeo/geocaching/Waypoint.java11
1 files changed, 2 insertions, 9 deletions
diff --git a/main/src/cgeo/geocaching/Waypoint.java b/main/src/cgeo/geocaching/Waypoint.java
index 5cfeb29..b4979e4 100644
--- a/main/src/cgeo/geocaching/Waypoint.java
+++ b/main/src/cgeo/geocaching/Waypoint.java
@@ -97,18 +97,11 @@ public class Waypoint implements IWaypoint {
if (newPrefixes.containsKey(prefix)) {
newPrefixes.get(prefix).merge(oldWaypoint);
} else if (oldWaypoint.isUserDefined() || forceMerge) {
- // personal note waypoints should always be taken from the new list only
- if (!isPersonalNoteWaypoint(oldWaypoint)) {
- newPoints.add(oldWaypoint);
- }
+ newPoints.add(oldWaypoint);
}
}
}
- private static boolean isPersonalNoteWaypoint(final @NonNull Waypoint waypoint) {
- return StringUtils.startsWith(waypoint.getName(), CgeoApplication.getInstance().getString(R.string.cache_personal_note) + " ");
- }
-
public boolean isUserDefined() {
return own || WaypointType.OWN == waypointType;
}
@@ -304,7 +297,7 @@ public class Waypoint implements IWaypoint {
((point.getLatitudeE6() % 1000) != 0 || (point.getLongitudeE6() % 1000) != 0)) {
final String name = CgeoApplication.getInstance().getString(R.string.cache_personal_note) + " " + count;
final String potentialWaypointType = note.substring(Math.max(0, matcher.start() - 15));
- final Waypoint waypoint = new Waypoint(name, parseWaypointType(potentialWaypointType), false);
+ final Waypoint waypoint = new Waypoint(name, parseWaypointType(potentialWaypointType), true);
waypoint.setCoords(point);
waypoints.add(waypoint);
count++;