aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2011-09-29 11:19:50 +0200
committerSamuel Tardieu <sam@rfc1149.net>2011-09-29 11:33:57 +0200
commitd969637560f66899026e09df3a0488d65237db7d (patch)
tree03501d8bc911cfcdd902f0df22201dcd66c15d29 /main/src
parent88b6b1a263e48597f19e0ad7276493121161621e (diff)
downloadcgeo-d969637560f66899026e09df3a0488d65237db7d.zip
cgeo-d969637560f66899026e09df3a0488d65237db7d.tar.gz
cgeo-d969637560f66899026e09df3a0488d65237db7d.tar.bz2
Use real parameters instead of a Map for searchByOwner()
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/cgBase.java21
-rw-r--r--main/src/cgeo/geocaching/cgeocaches.java2
2 files changed, 6 insertions, 17 deletions
diff --git a/main/src/cgeo/geocaching/cgBase.java b/main/src/cgeo/geocaching/cgBase.java
index 96df3b3..9556fe2 100644
--- a/main/src/cgeo/geocaching/cgBase.java
+++ b/main/src/cgeo/geocaching/cgBase.java
@@ -2452,7 +2452,7 @@ public class cgBase {
/**
* Insert the right cache type restriction in parameters
- *
+ *
* @param params
* the parameters to insert the restriction into
* @param cacheType
@@ -2692,26 +2692,15 @@ public class cgBase {
return search.getCurrentId();
}
- public UUID searchByOwner(cgSearchThread thread, Map<String, String> parameters, int reason, boolean showCaptcha) {
+ public UUID searchByOwner(final cgSearchThread thread, final String userName, final String cacheType, final int reason, final boolean showCaptcha) {
final cgSearch search = new cgSearch();
- final String userName = parameters.get("username");
- String cacheType = parameters.get("cachetype");
-
if (StringUtils.isBlank(userName)) {
Log.e(cgSettings.tag, "cgeoBase.searchByOwner: No user name given");
return null;
}
- if (StringUtils.isBlank(cacheType)) {
- cacheType = null;
- }
-
final Parameters params = new Parameters();
- if (cacheType != null && cacheIDs.containsKey(cacheType)) {
- params.put("tx", cacheIDs.get(cacheType));
- } else {
- params.put("tx", cacheIDs.get("all"));
- }
+ insertCacheType(params, cacheType);
params.put("u", userName);
final String uri = "http://www.geocaching.com/seek/nearest.aspx";
@@ -2733,9 +2722,9 @@ public class cgBase {
return null;
}
- List<cgCache> cacheList = processSearchResults(search, caches, settings.excludeDisabled, 0, null);
+ List<cgCache> cacheList = processSearchResults(search, caches, settings.excludeDisabled, reason, null);
- app.addSearch(search, cacheList, true, reason);
+ app.addSearch(search, cacheList, true, 0);
return search.getCurrentId();
}
diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java
index 560ad0a..11313c0 100644
--- a/main/src/cgeo/geocaching/cgeocaches.java
+++ b/main/src/cgeo/geocaching/cgeocaches.java
@@ -1923,7 +1923,7 @@ public class cgeocaches extends AbstractListActivity {
params.put("username", username);
params.put("cachetype", cachetype);
- searchId = base.searchByOwner(this, params, 0, settings.showCaptcha);
+ searchId = base.searchByOwner(this, username, cachetype, 0, settings.showCaptcha);
handler.sendMessage(new Message());
}