This commit is contained in:
PaulStets 2017-09-19 16:02:38 +03:00
parent 63b3cdaa18
commit db5d79fa2d

View file

@ -55,6 +55,8 @@ import net.osmand.plus.download.DownloadActivity;
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
import net.osmand.plus.download.IndexItem; import net.osmand.plus.download.IndexItem;
import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.helpers.FileNameTranslationHelper;
import net.osmand.plus.inapp.InAppHelper;
import net.osmand.plus.resources.IncrementalChangesManager;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import java.io.File; import java.io.File;
@ -465,6 +467,13 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
if (operation == DELETE_OPERATION) { if (operation == DELETE_OPERATION) {
File f = new File(info.getPathToData()); File f = new File(info.getPathToData());
successfull = Algorithms.removeAllFiles(f); successfull = Algorithms.removeAllFiles(f);
if (InAppHelper.isSubscribedToLiveUpdates()) {
String fileNameWithoutExtension =
Algorithms.getFileNameWithoutExtension(f);
IncrementalChangesManager changesManager =
getMyApplication().getResourceManager().getChangesManager();
changesManager.deleteUpdates(fileNameWithoutExtension);
}
if (successfull) { if (successfull) {
getMyApplication().getResourceManager().closeFile(info.getFileName()); getMyApplication().getResourceManager().closeFile(info.getFileName());
} }