From 884e9135dffc08d4f51a96635e6b5fd32b9d7051 Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Thu, 30 Jul 2020 08:59:22 +0300 Subject: [PATCH] Fix "Any edits of the group name don't affect for a future group" --- OsmAnd/src/net/osmand/data/FavouritePoint.java | 7 ++++++- .../src/net/osmand/plus/myplaces/TrackPointFragment.java | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/data/FavouritePoint.java b/OsmAnd/src/net/osmand/data/FavouritePoint.java index 052949a28f..72cde20159 100644 --- a/OsmAnd/src/net/osmand/data/FavouritePoint.java +++ b/OsmAnd/src/net/osmand/data/FavouritePoint.java @@ -371,8 +371,13 @@ public class FavouritePoint implements Serializable, LocationPoint { } public static FavouritePoint fromWpt(@NonNull WptPt pt, @NonNull Context ctx) { + return fromWpt(pt, ctx, null); + } + + public static FavouritePoint fromWpt(@NonNull WptPt pt, @NonNull Context ctx, String category) { String name = pt.name; - String categoryName = pt.category != null ? pt.category : ""; + String categoryName = category != null ? category : + (pt.category != null ? pt.category : ""); if (name == null) { name = ""; } diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java index 5f206edabb..d6d91b5042 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java @@ -622,7 +622,8 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements FavouritesDbHelper fdb = app.getFavorites(); for (GpxDisplayItem i : getSelectedItems()) { if (i.locationStart != null) { - FavouritePoint fp = FavouritePoint.fromWpt(i.locationStart, app); + FavouritePoint fp = FavouritePoint.fromWpt( + i.locationStart, app, editText.getText().toString()); if (!Algorithms.isEmpty(i.description)) { fp.setDescription(i.description); }