aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils/LogTemplateProvider.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/utils/LogTemplateProvider.java')
-rw-r--r--main/src/cgeo/geocaching/utils/LogTemplateProvider.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/utils/LogTemplateProvider.java b/main/src/cgeo/geocaching/utils/LogTemplateProvider.java
index 141e3d9..8606649 100644
--- a/main/src/cgeo/geocaching/utils/LogTemplateProvider.java
+++ b/main/src/cgeo/geocaching/utils/LogTemplateProvider.java
@@ -85,13 +85,16 @@ public class LogTemplateProvider {
@Override
public String getValue(final boolean offline) {
- if (offline) {
- return "";
+ int current = cgBase.getActualCachesFound();
+ if (current == 0) {
+ if (offline) {
+ return "";
+ }
+ final String page = cgBase.getResponseData(cgBase.request("http://www.geocaching.com/email/", null, false, false, false));
+ current = parseFindCount(page);
}
- String findCount = "";
- final String page = cgBase.getResponseData(cgBase.request("http://www.geocaching.com/email/", null, false, false, false));
- int current = parseFindCount(page);
+ String findCount = "";
if (current >= 0) {
findCount = String.valueOf(current + 1);
}