diff options
author | Marco Jacob <mjacob@union06.de> | 2012-03-22 22:08:09 +0100 |
---|---|---|
committer | Marco Jacob <mjacob@union06.de> | 2012-03-22 22:08:09 +0100 |
commit | 0be23a2477cf94a3c6fa5765e8eb2b3ddb2ed018 (patch) | |
tree | 034d4d1cca8571c1eef235a536262d4f06c3d56d /main | |
parent | 6c1db80d3270ddaeff1e4965c104e6b07edf3ef6 (diff) | |
download | cgeo-0be23a2477cf94a3c6fa5765e8eb2b3ddb2ed018.zip cgeo-0be23a2477cf94a3c6fa5765e8eb2b3ddb2ed018.tar.gz cgeo-0be23a2477cf94a3c6fa5765e8eb2b3ddb2ed018.tar.bz2 |
GPXImporter.importStaticMaps only loads cache when needed
Diffstat (limited to 'main')
-rw-r--r-- | main/src/cgeo/geocaching/files/GPXImporter.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/files/GPXImporter.java b/main/src/cgeo/geocaching/files/GPXImporter.java index 01469aa..8224437 100644 --- a/main/src/cgeo/geocaching/files/GPXImporter.java +++ b/main/src/cgeo/geocaching/files/GPXImporter.java @@ -34,7 +34,6 @@ import java.util.Collection; import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
-import java.util.Set;
import java.util.concurrent.CancellationException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@@ -188,10 +187,10 @@ public class GPXImporter { private void importStaticMaps(final SearchResult importedCaches) {
final cgeoapplication app = cgeoapplication.getInstance();
- Set<cgCache> caches = importedCaches.getCachesFromSearchResult(LoadFlags.LOAD_WAYPOINTS);
int storedCacheMaps = 0;
- for (cgCache cache : caches) {
- Log.d(Settings.tag, "GPXImporter.ImportThread.importStaticMaps start downloadMaps");
+ for (String geocode : importedCaches.getGeocodes()) {
+ cgCache cache = app.loadCache(geocode, LoadFlags.LOAD_WAYPOINTS);
+ Log.d(Settings.tag, "GPXImporter.ImportThread.importStaticMaps start downloadMaps for cache " + geocode);
StaticMapsProvider.downloadMaps(cache, app);
storedCacheMaps++;
if (progressHandler.isCancelled()) {
|