aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/connector
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-07-03 21:23:55 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-07-03 21:23:55 +0200
commit162d4e737cdcf68667b45d43722476f605eaddd7 (patch)
tree1f3a2720238f63dd35b4ef2c0bef8139e20af471 /main/src/cgeo/geocaching/connector
parentd67d24bdcab48dcb21518a58c116fe23cd2356ae (diff)
downloadcgeo-162d4e737cdcf68667b45d43722476f605eaddd7.zip
cgeo-162d4e737cdcf68667b45d43722476f605eaddd7.tar.gz
cgeo-162d4e737cdcf68667b45d43722476f605eaddd7.tar.bz2
fix #2957: "load more caches" wrongly enabled
Diffstat (limited to 'main/src/cgeo/geocaching/connector')
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCParser.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java
index 8464c7d..39a8891 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCParser.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java
@@ -120,6 +120,7 @@ public abstract class GCParser {
final String[] rows = page.split("<tr class=");
final int rows_count = rows.length;
+ int excludedCaches = 0;
for (int z = 1; z < rows_count; z++) {
final Geocache cache = new Geocache();
final String row = rows[z];
@@ -157,6 +158,7 @@ public abstract class GCParser {
if (Settings.isExcludeDisabledCaches() && (cache.isDisabled() || cache.isArchived())) {
// skip disabled and archived caches
+ excludedCaches++;
continue;
}
@@ -252,7 +254,7 @@ public abstract class GCParser {
try {
final String result = TextUtils.getMatch(page, GCConstants.PATTERN_SEARCH_TOTALCOUNT, false, 1, null, true);
if (null != result) {
- searchResult.setTotal(Integer.parseInt(result));
+ searchResult.setTotal(Integer.parseInt(result) - excludedCaches);
}
} catch (final NumberFormatException e) {
Log.w("GCParser.parseSearch: Failed to parse cache count");