diff options
author | Bananeweizen <Bananeweizen@gmx.de> | 2012-11-27 09:05:40 +0100 |
---|---|---|
committer | Bananeweizen <Bananeweizen@gmx.de> | 2012-11-27 09:05:40 +0100 |
commit | ffbed572e4158afe4217e9528cb26c321a34bd8c (patch) | |
tree | 8d23c08cd19326c8d6f548fa6b5a9a3ea1897b15 /main | |
parent | 57c75c64d989d01e985b52eab6e93d44da539f28 (diff) | |
parent | 06608af852274ce5c394e647795c1763e2509080 (diff) | |
download | cgeo-ffbed572e4158afe4217e9528cb26c321a34bd8c.zip cgeo-ffbed572e4158afe4217e9528cb26c321a34bd8c.tar.gz cgeo-ffbed572e4158afe4217e9528cb26c321a34bd8c.tar.bz2 |
Merge branch 'release'
Diffstat (limited to 'main')
-rw-r--r-- | main/src/cgeo/geocaching/cgCache.java | 23 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/files/GPXParser.java | 5 |
2 files changed, 23 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java index 76dca5b..230e84e 100644 --- a/main/src/cgeo/geocaching/cgCache.java +++ b/main/src/cgeo/geocaching/cgCache.java @@ -19,6 +19,7 @@ import cgeo.geocaching.enumerations.LoadFlags.RemoveFlag; import cgeo.geocaching.enumerations.LoadFlags.SaveFlag; import cgeo.geocaching.enumerations.LogType; import cgeo.geocaching.enumerations.WaypointType; +import cgeo.geocaching.files.GPXParser; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.network.HtmlImage; import cgeo.geocaching.utils.CancellableHandler; @@ -130,6 +131,26 @@ public class cgCache implements ICache, IWaypoint { private Handler changeNotificationHandler = null; + /** + * Create a new cache. To be used everywhere except for the GPX parser + */ + public cgCache() { + // empty + } + + /** + * Cache constructor to be used by the GPX parser only. This constructor explicitly sets several members to empty + * lists. + * + * @param gpxParser + */ + public cgCache(GPXParser gpxParser) { + setReliableLatLon(true); + setAttributes(Collections.<String> emptyList()); + setWaypoints(Collections.<cgWaypoint> emptyList(), false); + setLogs(Collections.<LogEntry> emptyList()); + } + public void setChangeNotificationHandler(Handler newNotificationHandler) { changeNotificationHandler = newNotificationHandler; } @@ -1612,4 +1633,4 @@ public class cgCache implements ICache, IWaypoint { } return result; } -}
\ No newline at end of file +} diff --git a/main/src/cgeo/geocaching/files/GPXParser.java b/main/src/cgeo/geocaching/files/GPXParser.java index 879814e..c451ad5 100644 --- a/main/src/cgeo/geocaching/files/GPXParser.java +++ b/main/src/cgeo/geocaching/files/GPXParser.java @@ -854,10 +854,7 @@ public abstract class GPXParser extends FileParser { desc = null; cmt = null; - cache = new cgCache(); - cache.setReliableLatLon(true); - cache.setAttributes(new ArrayList<String>()); - cache.setWaypoints(new ArrayList<cgWaypoint>(), false); + cache = new cgCache(this); for (int i = 0; i < userData.length; i++) { userData[i] = null; } |