From a8f780a46c40557ea2da440058ec3bf64bc728a2 Mon Sep 17 00:00:00 2001 From: Skalii Date: Mon, 29 Mar 2021 21:48:37 +0300 Subject: [PATCH 1/2] fix hiding gpx files on maps after deleting from my places p1 --- .../net/osmand/plus/myplaces/AvailableGPXFragment.java | 8 +++----- OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index b5f33884ac..12bcca4b51 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -1507,17 +1507,15 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement int total = 0; for (GpxInfo info : params) { if (!isCancelled() && (info.gpx == null || !info.gpx.showCurrentTrack)) { - boolean successfull; - successfull = removeAllFiles(info.file); - app.getGpxDbHelper().remove(info.file); + boolean successful = FileUtils.removeGpxFile(app, info.file); total++; - if (successfull) { + if (successful) { count++; publishProgress(info); } } } - return app.getString(R.string.local_index_items_deleted, count, total); + return getString(R.string.local_index_items_deleted, count, total); } @Override diff --git a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java index b2d3aaa7dd..ef2bd196a7 100644 --- a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java @@ -866,7 +866,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card R.string.shared_string_ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - if (FileUtils.removeGpxFile(app, new File((gpxFile.path)))) { + if (FileUtils.removeGpxFile(app, new File(gpxFile.path))) { dismiss(); } } From 48092f0e23d38b8abf942df1d2f4d15b02c0d9dd Mon Sep 17 00:00:00 2001 From: Skalii Date: Mon, 29 Mar 2021 21:48:50 +0300 Subject: [PATCH 2/2] fix hiding gpx files on maps after deleting from my places p2 --- OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 12bcca4b51..a2eaae19d0 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -1290,13 +1290,14 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement // local_indexes_cat_gpx now obsolete in new UI screen which shows only GPX data // if (Algorithms.objectEquals(getActivity().getString(R.string.local_indexes_cat_gpx) + " " + // g.subfolder, cat)) { - if (objectEquals("" + g.subfolder, cat)) { + if (objectEquals(g.subfolder, cat)) { found = i; break; } } if (found != -1) { data.get(category.get(found)).remove(g); + selected.remove(g); } } }