aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo')
-rw-r--r--main/src/cgeo/geocaching/cgCache.java4
-rw-r--r--main/src/cgeo/geocaching/cgTrackable.java4
-rw-r--r--main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java18
-rw-r--r--main/src/cgeo/geocaching/files/LocalStorage.java3
-rw-r--r--main/src/cgeo/geocaching/network/HtmlImage.java6
5 files changed, 14 insertions, 21 deletions
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java
index 6977099..a91737c 100644
--- a/main/src/cgeo/geocaching/cgCache.java
+++ b/main/src/cgeo/geocaching/cgCache.java
@@ -2,6 +2,7 @@ package cgeo.geocaching;
import cgeo.geocaching.activity.IAbstractActivity;
import cgeo.geocaching.connector.ConnectorFactory;
+import cgeo.geocaching.connector.GCConnector;
import cgeo.geocaching.connector.IConnector;
import cgeo.geocaching.enumerations.CacheSize;
import cgeo.geocaching.enumerations.CacheType;
@@ -467,8 +468,7 @@ public class cgCache implements ICache {
@Override
public String getCacheId() {
- // TODO: Only valid for GC-cache
- if (StringUtils.isBlank(cacheId)) {
+ if (StringUtils.isBlank(cacheId) && getConnector().equals(GCConnector.getInstance())) {
return CryptUtils.convertToGcBase31(geocode);
}
diff --git a/main/src/cgeo/geocaching/cgTrackable.java b/main/src/cgeo/geocaching/cgTrackable.java
index 95971f8..b8c8958 100644
--- a/main/src/cgeo/geocaching/cgTrackable.java
+++ b/main/src/cgeo/geocaching/cgTrackable.java
@@ -3,6 +3,7 @@ package cgeo.geocaching;
import org.apache.commons.lang3.StringUtils;
import android.text.Html;
+import android.util.Log;
import java.util.ArrayList;
import java.util.Date;
@@ -41,8 +42,7 @@ public class cgTrackable implements ILogable {
int id = Integer.parseInt(hex, 16);
return "http://geokrety.org/konkret.php?id=" + id;
} catch (NumberFormatException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.e(Settings.tag, "cgTrackable.getUrl", e);
return null;
}
}
diff --git a/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java b/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java
index b894c70..83d6487 100644
--- a/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java
+++ b/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java
@@ -1,6 +1,7 @@
package cgeo.geocaching.connector.opencaching;
import cgeo.geocaching.Parameters;
+import cgeo.geocaching.Settings;
import cgeo.geocaching.cgBase;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgImage;
@@ -20,6 +21,7 @@ import org.json.JSONObject;
import android.net.Uri;
import android.text.Html;
+import android.util.Log;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -112,8 +114,7 @@ final public class OkapiClient {
return caches;
}
} catch (JSONException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.e(Settings.tag, "OkapiClient.parseCaches", e);
}
return null;
}
@@ -173,8 +174,7 @@ final public class OkapiClient {
cache.setHidden(parseDate(response.getString(CACHE_HIDDEN)));
} catch (JSONException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.e(Settings.tag, "OkapiClient.parseCache", e);
}
return cache;
}
@@ -215,10 +215,8 @@ final public class OkapiClient {
}
result.add(log);
} catch (JSONException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.e(Settings.tag, "OkapiClient.parseLogs", e);
}
-
}
return result;
}
@@ -239,8 +237,7 @@ final public class OkapiClient {
try {
return ISO8601DATEFORMAT.parse(strippedDate);
} catch (ParseException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.e(Settings.tag, "OkapiClient.parseDate", e);
}
return null;
}
@@ -257,8 +254,7 @@ final public class OkapiClient {
try {
size = response.getDouble("size");
} catch (JSONException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.e(Settings.tag, "OkapiClient.getCacheSize", e);
}
switch ((int) Math.round(size)) {
case 1:
diff --git a/main/src/cgeo/geocaching/files/LocalStorage.java b/main/src/cgeo/geocaching/files/LocalStorage.java
index 932bbf7..c127e89 100644
--- a/main/src/cgeo/geocaching/files/LocalStorage.java
+++ b/main/src/cgeo/geocaching/files/LocalStorage.java
@@ -191,8 +191,7 @@ public class LocalStorage {
try {
input.close();
} catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
+ // ignore
}
}
return false;
diff --git a/main/src/cgeo/geocaching/network/HtmlImage.java b/main/src/cgeo/geocaching/network/HtmlImage.java
index 6098f5a..7c02c32 100644
--- a/main/src/cgeo/geocaching/network/HtmlImage.java
+++ b/main/src/cgeo/geocaching/network/HtmlImage.java
@@ -211,15 +211,13 @@ public class HtmlImage implements Html.ImageGetter {
fis = new FileInputStream(file);
BitmapFactory.decodeStream(fis, null, options);
} catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.e(Settings.tag, "HtmlImage.setSampleSize", e);
} finally {
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ // ignore
}
}
}