another solution to issue fix
This commit is contained in:
parent
caa2c08454
commit
6dfc75fd28
3 changed files with 10 additions and 13 deletions
|
@ -69,12 +69,6 @@ public class GpxSelectionHelper {
|
||||||
saveCurrentSelections();
|
saveCurrentSelections();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearAllGpxFilesWithoutBackup() {
|
|
||||||
selectedGpxFilesBackUp.clear();
|
|
||||||
selectedGPXFiles = new ArrayList<>();
|
|
||||||
saveCurrentSelections();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void restoreSelectedGpxFiles() {
|
public void restoreSelectedGpxFiles() {
|
||||||
for (Entry<GPXFile, Long> gpxEntry : selectedGpxFilesBackUp.entrySet()) {
|
for (Entry<GPXFile, Long> gpxEntry : selectedGpxFilesBackUp.entrySet()) {
|
||||||
if (!Algorithms.isEmpty(gpxEntry.getKey().path)) {
|
if (!Algorithms.isEmpty(gpxEntry.getKey().path)) {
|
||||||
|
|
|
@ -161,15 +161,18 @@ public class ConfigureMapMenu {
|
||||||
for (GpxSelectionHelper.SelectedGpxFile file : selectedGpxFiles) {
|
for (GpxSelectionHelper.SelectedGpxFile file : selectedGpxFiles) {
|
||||||
files.add(file.getGpxFile().path);
|
files.add(file.getGpxFile().path);
|
||||||
}
|
}
|
||||||
Map<GPXUtilities.GPXFile, Long> fls = selectedGpxHelper.getSelectedGpxFilesBackUp();
|
if (selectedGpxFiles.isEmpty()) {
|
||||||
for(Map.Entry<GPXUtilities.GPXFile, Long> f : fls.entrySet()) {
|
Map<GPXUtilities.GPXFile, Long> fls = selectedGpxHelper.getSelectedGpxFilesBackUp();
|
||||||
if(!Algorithms.isEmpty(f.getKey().path)) {
|
for(Map.Entry<GPXUtilities.GPXFile, Long> f : fls.entrySet()) {
|
||||||
File file = new File(f.getKey().path);
|
if(!Algorithms.isEmpty(f.getKey().path)) {
|
||||||
if(file.exists() && !file.isDirectory()) {
|
File file = new File(f.getKey().path);
|
||||||
files.add(f.getKey().path);
|
if(file.exists() && !file.isDirectory()) {
|
||||||
|
files.add(f.getKey().path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -613,7 +613,7 @@ public class GpxUiHelper {
|
||||||
//clear all previously selected files before adding new one
|
//clear all previously selected files before adding new one
|
||||||
OsmandApplication app = (OsmandApplication) activity.getApplication();
|
OsmandApplication app = (OsmandApplication) activity.getApplication();
|
||||||
if (app != null && app.getSelectedGpxHelper() != null) {
|
if (app != null && app.getSelectedGpxHelper() != null) {
|
||||||
app.getSelectedGpxHelper().clearAllGpxFilesWithoutBackup();
|
app.getSelectedGpxHelper().clearAllGpxFileToShow();
|
||||||
}
|
}
|
||||||
if (app != null && showCurrentGpx && adapter.getItem(0).getSelected()) {
|
if (app != null && showCurrentGpx && adapter.getItem(0).getSelected()) {
|
||||||
currentGPX = app.getSavingTrackHelper().getCurrentGpx();
|
currentGPX = app.getSavingTrackHelper().getCurrentGpx();
|
||||||
|
|
Loading…
Reference in a new issue