From 555145f04b8d36006c68fa0f0af646200ef456b4 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 21 Oct 2015 17:00:58 +0200 Subject: [PATCH] Fix update all --- .../src/net/osmand/plus/download/DownloadIndexesThread.java | 2 ++ OsmAnd/src/net/osmand/plus/download/DownloadResources.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java index 44dd235928..db33143108 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java @@ -425,6 +425,8 @@ public class DownloadIndexesThread { warn += " " + wn; } filesToReindex.clear(); + // slow down but let update all button work properly + indexes.updateFilesToUpdate();; } } } finally { diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java index 9140e2b517..4ad6a95792 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java @@ -124,6 +124,10 @@ public class DownloadResources extends DownloadResourceGroup { protected void updateFilesToUpdate() { initAlreadyLoadedFiles(); + recalculateFilesToUpdate(); + } + + private void recalculateFilesToUpdate() { List stillUpdate = new ArrayList(); for (IndexItem item : itemsToUpdate) { String sfName = item.getTargetFileName();