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();
|
||||
}
|
||||
|
||||
public void clearAllGpxFilesWithoutBackup() {
|
||||
selectedGpxFilesBackUp.clear();
|
||||
selectedGPXFiles = new ArrayList<>();
|
||||
saveCurrentSelections();
|
||||
}
|
||||
|
||||
public void restoreSelectedGpxFiles() {
|
||||
for (Entry<GPXFile, Long> gpxEntry : selectedGpxFilesBackUp.entrySet()) {
|
||||
if (!Algorithms.isEmpty(gpxEntry.getKey().path)) {
|
||||
|
|
|
@ -161,15 +161,18 @@ public class ConfigureMapMenu {
|
|||
for (GpxSelectionHelper.SelectedGpxFile file : selectedGpxFiles) {
|
||||
files.add(file.getGpxFile().path);
|
||||
}
|
||||
Map<GPXUtilities.GPXFile, Long> fls = selectedGpxHelper.getSelectedGpxFilesBackUp();
|
||||
for(Map.Entry<GPXUtilities.GPXFile, Long> f : fls.entrySet()) {
|
||||
if(!Algorithms.isEmpty(f.getKey().path)) {
|
||||
File file = new File(f.getKey().path);
|
||||
if(file.exists() && !file.isDirectory()) {
|
||||
files.add(f.getKey().path);
|
||||
if (selectedGpxFiles.isEmpty()) {
|
||||
Map<GPXUtilities.GPXFile, Long> fls = selectedGpxHelper.getSelectedGpxFilesBackUp();
|
||||
for(Map.Entry<GPXUtilities.GPXFile, Long> f : fls.entrySet()) {
|
||||
if(!Algorithms.isEmpty(f.getKey().path)) {
|
||||
File file = new File(f.getKey().path);
|
||||
if(file.exists() && !file.isDirectory()) {
|
||||
files.add(f.getKey().path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
|
|
|
@ -613,7 +613,7 @@ public class GpxUiHelper {
|
|||
//clear all previously selected files before adding new one
|
||||
OsmandApplication app = (OsmandApplication) activity.getApplication();
|
||||
if (app != null && app.getSelectedGpxHelper() != null) {
|
||||
app.getSelectedGpxHelper().clearAllGpxFilesWithoutBackup();
|
||||
app.getSelectedGpxHelper().clearAllGpxFileToShow();
|
||||
}
|
||||
if (app != null && showCurrentGpx && adapter.getItem(0).getSelected()) {
|
||||
currentGPX = app.getSavingTrackHelper().getCurrentGpx();
|
||||
|
|
Loading…
Reference in a new issue