aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/files
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2013-09-13 09:22:41 +0200
committerSamuel Tardieu <sam@rfc1149.net>2013-09-13 09:46:36 +0200
commit15282e600a818c2e4d3b5fc21e8a2d5143d818e5 (patch)
tree3491c025204d27052d36664d1302a6e5defbb9b7 /main/src/cgeo/geocaching/files
parente0d2a7ff191024c39b3b65fd7f0d52d6340bebbe (diff)
downloadcgeo-15282e600a818c2e4d3b5fc21e8a2d5143d818e5.zip
cgeo-15282e600a818c2e4d3b5fc21e8a2d5143d818e5.tar.gz
cgeo-15282e600a818c2e4d3b5fc21e8a2d5143d818e5.tar.bz2
refactoring: cgData -> DataStore
Diffstat (limited to 'main/src/cgeo/geocaching/files')
-rw-r--r--main/src/cgeo/geocaching/files/GPXImporter.java4
-rw-r--r--main/src/cgeo/geocaching/files/GPXParser.java12
-rw-r--r--main/src/cgeo/geocaching/files/LocParser.java4
3 files changed, 10 insertions, 10 deletions
diff --git a/main/src/cgeo/geocaching/files/GPXImporter.java b/main/src/cgeo/geocaching/files/GPXImporter.java
index 3f11c26..bf0aa72 100644
--- a/main/src/cgeo/geocaching/files/GPXImporter.java
+++ b/main/src/cgeo/geocaching/files/GPXImporter.java
@@ -4,7 +4,7 @@ import cgeo.geocaching.Geocache;
import cgeo.geocaching.R;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.StaticMapsProvider;
-import cgeo.geocaching.cgData;
+import cgeo.geocaching.DataStore;
import cgeo.geocaching.activity.ActivityMixin;
import cgeo.geocaching.activity.Progress;
import cgeo.geocaching.enumerations.LoadFlags;
@@ -175,7 +175,7 @@ public class GPXImporter {
private boolean importStaticMaps(final SearchResult importedCaches) {
int storedCacheMaps = 0;
for (final String geocode : importedCaches.getGeocodes()) {
- final Geocache cache = cgData.loadCache(geocode, LoadFlags.LOAD_WAYPOINTS);
+ final Geocache cache = DataStore.loadCache(geocode, LoadFlags.LOAD_WAYPOINTS);
if (cache != null) {
Log.d("GPXImporter.ImportThread.importStaticMaps start downloadMaps for cache " + geocode);
StaticMapsProvider.downloadMaps(cache);
diff --git a/main/src/cgeo/geocaching/files/GPXParser.java b/main/src/cgeo/geocaching/files/GPXParser.java
index 3358759..431a529 100644
--- a/main/src/cgeo/geocaching/files/GPXParser.java
+++ b/main/src/cgeo/geocaching/files/GPXParser.java
@@ -1,12 +1,12 @@
package cgeo.geocaching.files;
+import cgeo.geocaching.DataStore;
import cgeo.geocaching.Geocache;
import cgeo.geocaching.LogEntry;
import cgeo.geocaching.R;
import cgeo.geocaching.StoredList;
import cgeo.geocaching.Trackable;
import cgeo.geocaching.Waypoint;
-import cgeo.geocaching.cgData;
import cgeo.geocaching.cgeoapplication;
import cgeo.geocaching.connector.ConnectorFactory;
import cgeo.geocaching.enumerations.CacheSize;
@@ -312,10 +312,10 @@ public abstract class GPXParser extends FileParser {
// finally store the cache in the database
result.add(geocode);
- cgData.saveCache(cache, EnumSet.of(SaveFlag.SAVE_DB));
+ DataStore.saveCache(cache, EnumSet.of(SaveFlag.SAVE_DB));
// avoid the cachecache using lots of memory for caches which the user did not actually look at
- cgData.removeAllFromCache();
+ DataStore.removeAllFromCache();
showProgressMessage(progressHandler, progressStream.getProgress());
} else if (StringUtils.isNotBlank(cache.getName())
&& StringUtils.containsIgnoreCase(type, "waypoint")) {
@@ -331,7 +331,7 @@ public abstract class GPXParser extends FileParser {
if (cache.getName().length() > 2) {
final String cacheGeocodeForWaypoint = "GC" + cache.getName().substring(2).toUpperCase(Locale.US);
// lookup cache for waypoint in already parsed caches
- final Geocache cacheForWaypoint = cgData.loadCache(cacheGeocodeForWaypoint, LoadFlags.LOAD_CACHE_OR_DB);
+ final Geocache cacheForWaypoint = DataStore.loadCache(cacheGeocodeForWaypoint, LoadFlags.LOAD_CACHE_OR_DB);
if (cacheForWaypoint != null) {
final Waypoint waypoint = new Waypoint(cache.getShortDescription(), convertWaypointSym2Type(sym), false);
waypoint.setId(-1);
@@ -349,7 +349,7 @@ public abstract class GPXParser extends FileParser {
newPoints.add(waypoint);
Waypoint.mergeWayPoints(newPoints, mergedWayPoints, true);
cacheForWaypoint.setWaypoints(newPoints, false);
- cgData.saveCache(cacheForWaypoint, EnumSet.of(SaveFlag.SAVE_DB));
+ DataStore.saveCache(cacheForWaypoint, EnumSet.of(SaveFlag.SAVE_DB));
showProgressMessage(progressHandler, progressStream.getProgress());
}
}
@@ -785,7 +785,7 @@ public abstract class GPXParser extends FileParser {
try {
progressStream = new ProgressInputStream(stream);
Xml.parse(progressStream, Xml.Encoding.UTF_8, root.getContentHandler());
- return cgData.loadCaches(result, EnumSet.of(LoadFlag.LOAD_DB_MINIMAL));
+ return DataStore.loadCaches(result, EnumSet.of(LoadFlag.LOAD_DB_MINIMAL));
} catch (final SAXException e) {
Log.w("Cannot parse .gpx file as GPX " + version + ": could not parse XML - ", e);
throw new ParserException("Cannot parse .gpx file as GPX " + version + ": could not parse XML", e);
diff --git a/main/src/cgeo/geocaching/files/LocParser.java b/main/src/cgeo/geocaching/files/LocParser.java
index 1cfb2a3..3d01c1b 100644
--- a/main/src/cgeo/geocaching/files/LocParser.java
+++ b/main/src/cgeo/geocaching/files/LocParser.java
@@ -1,8 +1,8 @@
package cgeo.geocaching.files;
+import cgeo.geocaching.DataStore;
import cgeo.geocaching.Geocache;
import cgeo.geocaching.SearchResult;
-import cgeo.geocaching.cgData;
import cgeo.geocaching.enumerations.CacheSize;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.LoadFlags;
@@ -59,7 +59,7 @@ public final class LocParser extends FileParser {
contained.add(geocode);
}
}
- Set<Geocache> caches = cgData.loadCaches(contained, LoadFlags.LOAD_CACHE_OR_DB);
+ Set<Geocache> caches = DataStore.loadCaches(contained, LoadFlags.LOAD_CACHE_OR_DB);
for (Geocache cache : caches) {
Geocache coord = cidCoords.get(cache.getGeocode());
copyCoordToCache(coord, cache);