aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/cgBase.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgeo/geocaching/cgBase.java')
-rw-r--r--src/cgeo/geocaching/cgBase.java61
1 files changed, 33 insertions, 28 deletions
diff --git a/src/cgeo/geocaching/cgBase.java b/src/cgeo/geocaching/cgBase.java
index 90f69f1..f9ee8c2 100644
--- a/src/cgeo/geocaching/cgBase.java
+++ b/src/cgeo/geocaching/cgBase.java
@@ -759,16 +759,19 @@ public class cgBase {
}
// cache direction - image
- try {
- final Matcher matcherDirection = patternDirection.matcher(row);
- while (matcherDirection.find()) {
- if (matcherDirection.groupCount() > 0) {
- cache.directionImg = matcherDirection.group(1);
- }
- }
- } catch (Exception e) {
- // failed to parse direction image
- Log.w(cgSettings.tag, "cgeoBase.parseSearch: Failed to parse cache direction image");
+ if (settings.loadDirectionImg)
+ {
+ try {
+ final Matcher matcherDirection = patternDirection.matcher(row);
+ while (matcherDirection.find()) {
+ if (matcherDirection.groupCount() > 0) {
+ cache.directionImg = matcherDirection.group(1);
+ }
+ }
+ } catch (Exception e) {
+ // failed to parse direction image
+ Log.w(cgSettings.tag, "cgeoBase.parseSearch: Failed to parse cache direction image");
+ }
}
// cache inventory
@@ -945,10 +948,13 @@ public class cgBase {
}
// get direction images
- for (cgCache oneCache : caches.cacheList) {
- if (oneCache.latitude == null && oneCache.longitude == null && oneCache.direction == null && oneCache.directionImg != null) {
- cgDirectionImg.getDrawable(oneCache.geocode, oneCache.directionImg);
- }
+ if (settings.loadDirectionImg)
+ {
+ for (cgCache oneCache : caches.cacheList) {
+ if (oneCache.latitude == null && oneCache.longitude == null && oneCache.directionImg != null) {
+ cgDirectionImg.getDrawable(oneCache.geocode, oneCache.directionImg);
+ }
+ }
}
// get ratings
@@ -1614,25 +1620,24 @@ public class cgBase {
try
{
- logDone.date = dateLogs1.parse(matcherLog.group(5)).getTime(); // long format
- }
- catch (ParseException e)
- {
- try
+ if (matcherLog.group(5).indexOf(',') > 0)
{
- // short format, with current year
- final Date date = dateLogs2.parse(matcherLog.group(5));
- final Calendar cal = Calendar.getInstance();
- final int year = cal.get(Calendar.YEAR);
- cal.setTime(date);
- cal.set(Calendar.YEAR, year);
- logDone.date = cal.getTimeInMillis();
+ logDone.date = dateLogs1.parse(matcherLog.group(5)).getTime(); // long format
}
- catch (ParseException ee)
+ else
{
- Log.w(cgSettings.tag, "Failed to parse logs date: " + ee.toString());
+ // short format, with current year
+ final Calendar cal = Calendar.getInstance();
+ final int year = cal.get(Calendar.YEAR);
+ cal.setTime(dateLogs2.parse(matcherLog.group(5)));
+ cal.set(Calendar.YEAR, year);
+ logDone.date = cal.getTimeInMillis();
}
}
+ catch (ParseException e)
+ {
+ Log.w(cgSettings.tag, "Failed to parse logs date: " + e.toString());
+ }
logDone.author = Html.fromHtml(matcherLog.group(1)).toString();