Fix issue with green backuped indexes

This commit is contained in:
Victor Shcherb 2012-02-05 19:00:34 +01:00
parent 31aa4d3ec4
commit 270d6e72d0
2 changed files with 13 additions and 1 deletions

View file

@ -797,7 +797,17 @@ public class ResourceManager {
}
public Map<String, String> getIndexFileNames() {
return indexFileNames;
return new LinkedHashMap<String, String>(indexFileNames);
}
public Map<String, String> getBackupIndexes(Map<String, String> map) {
File file = context.getSettings().extendOsmandPath(BACKUP_PATH);
for (File f : file.listFiles()) {
if (f.getName().endsWith(IndexConstants.BINARY_MAP_INDEX_EXT)) {
indexFileNames.put(f.getName(), MessageFormat.format("{0,date,dd.MM.yyyy}", new Date(f.lastModified()))); //$NON-NLS-1$
}
}
return map;
}
public synchronized void reloadTilesFromFS(){

View file

@ -149,6 +149,8 @@ public class DownloadIndexActivity extends ExpandableListActivity {
});
indexFileNames = ((OsmandApplication)getApplication()).getResourceManager().getIndexFileNames();
((OsmandApplication)getApplication()).getResourceManager().getBackupIndexes(indexFileNames);
filterText = (EditText) findViewById(R.id.search_box);
textWatcher = new TextWatcher() {