diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-06-11 07:38:26 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-06-11 07:38:26 +0200 |
| commit | 79a7ca7fe7d0fe9b079376fb700ffc0ea6972c80 (patch) | |
| tree | 45a5f864b626f38c68de6b71a2da26473bddb3bd | |
| parent | 4e5585e9051201e3561c170df0190e1bebf1bad4 (diff) | |
| parent | 5bdd6363a72cbe292cb3aa9deec0790db2b242f5 (diff) | |
| download | cgeo-79a7ca7fe7d0fe9b079376fb700ffc0ea6972c80.zip cgeo-79a7ca7fe7d0fe9b079376fb700ffc0ea6972c80.tar.gz cgeo-79a7ca7fe7d0fe9b079376fb700ffc0ea6972c80.tar.bz2 | |
Merge remote-tracking branch 'origin/release'
| -rw-r--r-- | main/res/values/changelog_release.xml | 4 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/enumerations/CacheType.java | 5 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/files/GPXParserTest.java | 12 |
3 files changed, 20 insertions, 1 deletions
diff --git a/main/res/values/changelog_release.xml b/main/res/values/changelog_release.xml index 86863cf..c7c06f8 100644 --- a/main/res/values/changelog_release.xml +++ b/main/res/values/changelog_release.xml @@ -2,6 +2,10 @@ <resources> <!-- changelog for the release branch --> <string name="changelog_release" translatable="false">\n + <b>Next bugfix release:</b>\n + · Fix: New gc.com GPX waypoint types recognized\n + · Fix: Do not crop static maps to prevent the copyright notice being cut off\n + \n <b>2014.05.14:</b>\n · Fix: Adapting to changes on geocaching.com\n \n diff --git a/main/src/cgeo/geocaching/enumerations/CacheType.java b/main/src/cgeo/geocaching/enumerations/CacheType.java index 535bfab..61ad2c2 100644 --- a/main/src/cgeo/geocaching/enumerations/CacheType.java +++ b/main/src/cgeo/geocaching/enumerations/CacheType.java @@ -16,7 +16,7 @@ public enum CacheType { TRADITIONAL("traditional", "Traditional Cache", "32bc9333-5e52-4957-b0f6-5a2c8fc7b257", R.string.traditional, R.drawable.type_traditional), MULTI("multi", "Multi-cache", "a5f6d0ad-d2f2-4011-8c14-940a9ebf3c74", R.string.multi, R.drawable.type_multi), - MYSTERY("mystery", "Unknown Cache", "40861821-1835-4e11-b666-8d41064d03fe", R.string.mystery, R.drawable.type_mystery), + MYSTERY("mystery", "Mystery Cache", "40861821-1835-4e11-b666-8d41064d03fe", R.string.mystery, R.drawable.type_mystery), LETTERBOX("letterbox", "Letterbox hybrid", "4bdd8fb2-d7bc-453f-a9c5-968563b15d24", R.string.letterbox, R.drawable.type_letterbox), EVENT("event", "Event Cache", "69eb8534-b718-4b35-ae3c-a856a55b0874", R.string.event, R.drawable.type_event), MEGA_EVENT("mega", "Mega-Event Cache", "69eb8535-b718-4b35-ae3c-a856a55b0874", R.string.mega, R.drawable.type_mega), @@ -68,6 +68,9 @@ public enum CacheType { mappingPattern.put(ct.pattern.toLowerCase(Locale.US), ct); mappingGuid.put(ct.guid, ct); } + // add old mystery type for GPX file compatibility + mappingPattern.put("Unknown Cache".toLowerCase(Locale.US), MYSTERY); + FIND_BY_ID = Collections.unmodifiableMap(mappingId); FIND_BY_PATTERN = Collections.unmodifiableMap(mappingPattern); FIND_BY_GUID = Collections.unmodifiableMap(mappingGuid); diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java index 49b0d53..a463dd8 100644 --- a/tests/src/cgeo/geocaching/files/GPXParserTest.java +++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java @@ -373,4 +373,16 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase { assertThat(cache.isPremiumMembersOnly()).isTrue(); } + public void testGPXMysteryType() throws IOException, ParserException { + final List<Geocache> caches = readGPX10(R.raw.tc2012); + Geocache mystery = null; + for (Geocache geocache : caches) { + if (geocache.getName().equals("U017")) { + mystery = geocache; + } + } + assertThat(mystery).isNotNull(); + assert (mystery != null); + assertThat(mystery.getType()).isEqualTo(CacheType.MYSTERY); + } } |
