Fix "Any edits of the group name don't affect for a future group"

This commit is contained in:
Nazar-Kutz 2020-07-30 08:59:22 +03:00
parent 1114a91be7
commit 884e9135df
2 changed files with 8 additions and 2 deletions

View file

@ -371,8 +371,13 @@ public class FavouritePoint implements Serializable, LocationPoint {
} }
public static FavouritePoint fromWpt(@NonNull WptPt pt, @NonNull Context ctx) { 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 name = pt.name;
String categoryName = pt.category != null ? pt.category : ""; String categoryName = category != null ? category :
(pt.category != null ? pt.category : "");
if (name == null) { if (name == null) {
name = ""; name = "";
} }

View file

@ -622,7 +622,8 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements
FavouritesDbHelper fdb = app.getFavorites(); FavouritesDbHelper fdb = app.getFavorites();
for (GpxDisplayItem i : getSelectedItems()) { for (GpxDisplayItem i : getSelectedItems()) {
if (i.locationStart != null) { 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)) { if (!Algorithms.isEmpty(i.description)) {
fp.setDescription(i.description); fp.setDescription(i.description);
} }