aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-05-13 23:05:19 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-05-13 23:05:19 +0200
commitc7668a899e8bba9ce0d974ab8ad77fdabfc49d41 (patch)
tree2b1d199447efeb8b088bb93445469b55eb0a5154 /main
parentc8f4ef5d5a7922e267764ff2cb96bbf69bd6208c (diff)
parent5f85f3b82eebd45337087afac23eb6adfdc8ea59 (diff)
downloadcgeo-c7668a899e8bba9ce0d974ab8ad77fdabfc49d41.zip
cgeo-c7668a899e8bba9ce0d974ab8ad77fdabfc49d41.tar.gz
cgeo-c7668a899e8bba9ce0d974ab8ad77fdabfc49d41.tar.bz2
Merge branch 'release' into upstream
Diffstat (limited to 'main')
-rw-r--r--main/res/values/changelog_release.xml25
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCConstants.java2
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCParser.java2
-rw-r--r--main/src/cgeo/geocaching/enumerations/CacheType.java12
4 files changed, 28 insertions, 13 deletions
diff --git a/main/res/values/changelog_release.xml b/main/res/values/changelog_release.xml
index a9ada95..f1c56ca 100644
--- a/main/res/values/changelog_release.xml
+++ b/main/res/values/changelog_release.xml
@@ -2,20 +2,23 @@
<resources>
<!-- changelog for the release branch -->
<string name="changelog_release" translatable="false">\n
+ <b>Next bugfix release:</b>\n
+ · New:
+ · Fix:
+ \n
+ \n
<b>2014.04.30:</b>\n
- <b>New features:</b>\n
- · Support new cache-type: Giga-Event\n
- · Integrate with MapsWithMe\n
- · Import external spoiler images from a Garmin-style file structure\n
- · Support more details in GPX export\n
- <b>Bugfixing:</b>\n
- · Fixed a number of crash scenarios/instabilities due to memory issues\n
- · Fixed problems when calling some external navigation apps\n
- · Fixed a crash when starting with a readonly cache directory\n
- · Have <b>attended</b> as default log type on day of event\n
+ · New: Support new cache type: Giga Event\n
+ · New: Integrate with MapsWithMe\n
+ · New: Import external spoiler images from a Garmin-style file structure\n
+ · New: Support more details in GPX export\n
+ · Fix: A number of crash scenarios/instabilities due to memory issues\n
+ · Fix: Problems when calling some external navigation apps\n
+ · Fix: Crash when starting with a readonly cache directory\n
+ · New: Have <b>attended</b> as default log type on day of event\n
\n
\n
- <a href="https://github.com/cgeo/cgeo/issues?milestone=29&amp;state=closed">Detailed list of all changes</a>\n
+ <a href="https://github.com/cgeo/cgeo/issues?milestone=30&amp;state=closed">Detailed list of all changes</a>\n
\n
<b>Old releases</b>\n
· Please refer to the release notes on the <a href="http://www.cgeo.org">c:geo-website</a>.\n
diff --git a/main/src/cgeo/geocaching/connector/gc/GCConstants.java b/main/src/cgeo/geocaching/connector/gc/GCConstants.java
index 5ee8993..305ac6f 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCConstants.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCConstants.java
@@ -47,7 +47,7 @@ public final class GCConstants {
public final static Pattern PATTERN_FOUND_ALTERNATIVE = Pattern.compile("<div class=\"StatusInformationWidget FavoriteWidget\"");
public final static Pattern PATTERN_FOUND_DATE = Pattern.compile(">Logged on: ([^<]+?)<");
public final static Pattern PATTERN_OWNER_DISPLAYNAME = Pattern.compile("<div id=\"ctl00_ContentBody_mcd1\">[^<]+<a href=\"[^\"]+\">([^<]+)</a>");
- public final static Pattern PATTERN_TYPE = Pattern.compile("<img src=\"[^\"]*/WptTypes/\\d+\\.gif\" alt=\"([^\"]+?)\"[^>]*>");
+ public final static Pattern PATTERN_TYPE = Pattern.compile("<a href=\"/seek/nearest.aspx\\?tx=([0-9a-f-]+)");
public final static Pattern PATTERN_HIDDEN = Pattern.compile("<div id=\"ctl00_ContentBody_mcd2\">\\W*Hidden[\\s:]*([^<]+?)</div>");
public final static Pattern PATTERN_HIDDENEVENT = Pattern.compile("Event\\s*Date\\s*:\\s*([^<]+)<div id=\"calLinks\">", Pattern.DOTALL);
public final static Pattern PATTERN_FAVORITE = Pattern.compile("<div id=\"pnlFavoriteCache\">"); // without 'class="hideMe"' inside the tag !
diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java
index 2d9ca9d..73d6c06 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCParser.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java
@@ -509,7 +509,7 @@ public abstract class GCParser {
cache.setFound(TextUtils.matches(page, GCConstants.PATTERN_FOUND) || TextUtils.matches(page, GCConstants.PATTERN_FOUND_ALTERNATIVE));
// cache type
- cache.setType(CacheType.getByPattern(TextUtils.getMatch(page, GCConstants.PATTERN_TYPE, true, cache.getType().id)));
+ cache.setType(CacheType.getByGuid(TextUtils.getMatch(page, GCConstants.PATTERN_TYPE, true, cache.getType().id)));
// on watchlist
cache.setOnWatchlist(TextUtils.matches(page, GCConstants.PATTERN_WATCHLIST));
diff --git a/main/src/cgeo/geocaching/enumerations/CacheType.java b/main/src/cgeo/geocaching/enumerations/CacheType.java
index 506c791..535bfab 100644
--- a/main/src/cgeo/geocaching/enumerations/CacheType.java
+++ b/main/src/cgeo/geocaching/enumerations/CacheType.java
@@ -58,15 +58,19 @@ public enum CacheType {
private final static Map<String, CacheType> FIND_BY_ID;
private final static Map<String, CacheType> FIND_BY_PATTERN;
+ private final static Map<String, CacheType> FIND_BY_GUID;
static {
final HashMap<String, CacheType> mappingId = new HashMap<String, CacheType>();
final HashMap<String, CacheType> mappingPattern = new HashMap<String, CacheType>();
+ final HashMap<String, CacheType> mappingGuid = new HashMap<String, CacheType>();
for (CacheType ct : values()) {
mappingId.put(ct.id, ct);
mappingPattern.put(ct.pattern.toLowerCase(Locale.US), ct);
+ mappingGuid.put(ct.guid, ct);
}
FIND_BY_ID = Collections.unmodifiableMap(mappingId);
FIND_BY_PATTERN = Collections.unmodifiableMap(mappingPattern);
+ FIND_BY_GUID = Collections.unmodifiableMap(mappingGuid);
}
public static CacheType getById(final String id) {
@@ -85,6 +89,14 @@ public enum CacheType {
return result;
}
+ public static CacheType getByGuid(final String id) {
+ final CacheType result = (id != null) ? CacheType.FIND_BY_GUID.get(id) : null;
+ if (result == null) {
+ return UNKNOWN;
+ }
+ return result;
+ }
+
public final String getL10n() {
return CgeoApplication.getInstance().getBaseContext().getResources().getString(stringId);
}