diff options
Diffstat (limited to 'main/src/cgeo/geocaching/connector/oc')
| -rw-r--r-- | main/src/cgeo/geocaching/connector/oc/OCConnector.java | 8 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/connector/oc/OkapiClient.java | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/connector/oc/OCConnector.java b/main/src/cgeo/geocaching/connector/oc/OCConnector.java index 34bf019..c098d12 100644 --- a/main/src/cgeo/geocaching/connector/oc/OCConnector.java +++ b/main/src/cgeo/geocaching/connector/oc/OCConnector.java @@ -33,7 +33,7 @@ public class OCConnector extends AbstractConnector { @Override public String getCacheUrl(cgCache cache) { - return "http://" + host + "/viewcache.php?wp=" + cache.getGeocode(); + return getCacheUrlPrefix() + cache.getGeocode(); } @Override @@ -45,4 +45,10 @@ public class OCConnector extends AbstractConnector { public boolean isZippedGPXFile(String fileName) { return gpxZipFilePattern.matcher(fileName).matches(); } + + @Override + protected String getCacheUrlPrefix() { + return "http://" + host + "/viewcache.php?wp="; + } + } diff --git a/main/src/cgeo/geocaching/connector/oc/OkapiClient.java b/main/src/cgeo/geocaching/connector/oc/OkapiClient.java index 87cc3a1..1121cc5 100644 --- a/main/src/cgeo/geocaching/connector/oc/OkapiClient.java +++ b/main/src/cgeo/geocaching/connector/oc/OkapiClient.java @@ -2,8 +2,8 @@ package cgeo.geocaching.connector.oc; import cgeo.geocaching.LogEntry; import cgeo.geocaching.cgCache; +import cgeo.geocaching.cgData; import cgeo.geocaching.cgImage; -import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.connector.ConnectorFactory; import cgeo.geocaching.connector.IConnector; import cgeo.geocaching.enumerations.CacheSize; @@ -153,9 +153,8 @@ final public class OkapiClient { final JSONArray images = response.getJSONArray(CACHE_IMAGES); if (images != null) { - JSONObject imageResponse; for (int i = 0; i < images.length(); i++) { - imageResponse = images.getJSONObject(i); + JSONObject imageResponse = images.getJSONObject(i); if (imageResponse.getBoolean(CACHE_IMAGE_IS_SPOILER)) { final String title = imageResponse.getString(CACHE_IMAGE_CAPTION); final String url = absoluteUrl(imageResponse.getString(CACHE_IMAGE_URL), cache.getGeocode()); @@ -171,9 +170,8 @@ final public class OkapiClient { cache.setUpdated(System.currentTimeMillis()); cache.setDetailedUpdate(cache.getUpdated()); cache.setDetailed(true); - // save full detailed caches - cgeoapplication.getInstance().saveCache(cache, EnumSet.of(SaveFlag.SAVE_DB)); + cgData.saveCache(cache, EnumSet.of(SaveFlag.SAVE_DB)); } catch (JSONException e) { Log.e("OkapiClient.parseCache", e); } |
