aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-06-03 16:15:34 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-06-04 20:39:44 +0200
commitccf1cb9eca3349b1ac5ceceb745634db6549d352 (patch)
tree24eaeaaba9aad8f48f97dad34d081d5ebf870fd2 /main/src
parent32baf729157be6eaee4f50014147d22c46691f52 (diff)
downloadcgeo-ccf1cb9eca3349b1ac5ceceb745634db6549d352.zip
cgeo-ccf1cb9eca3349b1ac5ceceb745634db6549d352.tar.gz
cgeo-ccf1cb9eca3349b1ac5ceceb745634db6549d352.tar.bz2
fix #1704: Filter applied to single cache request
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/SearchActivity.java11
-rw-r--r--main/src/cgeo/geocaching/cgeo.java7
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCConnector.java4
-rw-r--r--main/src/cgeo/geocaching/connector/oc/OCApiConnector.java4
-rw-r--r--main/src/cgeo/geocaching/connector/ox/OXConnector.java3
5 files changed, 15 insertions, 14 deletions
diff --git a/main/src/cgeo/geocaching/SearchActivity.java b/main/src/cgeo/geocaching/SearchActivity.java
index 5d4fa47..ae350c0 100644
--- a/main/src/cgeo/geocaching/SearchActivity.java
+++ b/main/src/cgeo/geocaching/SearchActivity.java
@@ -11,6 +11,7 @@ import cgeo.geocaching.utils.Log;
import org.apache.commons.lang3.StringUtils;
+import android.app.Activity;
import android.app.SearchManager;
import android.content.Intent;
import android.content.res.Configuration;
@@ -26,7 +27,7 @@ import android.widget.EditText;
public class SearchActivity extends AbstractActivity {
- public static final String EXTRAS_KEYWORDSEARCH = "keywordsearch";
+ private static final String EXTRAS_KEYWORDSEARCH = "keywordsearch";
private static final int MENU_SEARCH_OWN_CACHES = 1;
private EditText latEdit = null;
@@ -410,4 +411,12 @@ public class SearchActivity extends AbstractActivity {
}
return super.onOptionsItemSelected(item);
}
+
+ public static void startActivityScan(final String scan, final Activity fromActivity) {
+ final Intent searchIntent = new Intent(fromActivity, SearchActivity.class);
+ searchIntent.setAction(Intent.ACTION_SEARCH).
+ putExtra(SearchManager.QUERY, scan).
+ putExtra(SearchActivity.EXTRAS_KEYWORDSEARCH, false);
+ fromActivity.startActivityForResult(searchIntent, cgeo.SEARCH_REQUEST_CODE);
+ }
}
diff --git a/main/src/cgeo/geocaching/cgeo.java b/main/src/cgeo/geocaching/cgeo.java
index 35d0a22..1c81a63 100644
--- a/main/src/cgeo/geocaching/cgeo.java
+++ b/main/src/cgeo/geocaching/cgeo.java
@@ -391,12 +391,7 @@ public class cgeo extends AbstractActivity {
return;
}
- Intent searchIntent = new Intent(this, SearchActivity.class);
- searchIntent.setAction(Intent.ACTION_SEARCH).
- putExtra(SearchManager.QUERY, scan).
- putExtra(SearchActivity.EXTRAS_KEYWORDSEARCH, false);
- startActivityForResult(searchIntent, SEARCH_REQUEST_CODE);
-
+ SearchActivity.startActivityScan(scan, this);
} else if (resultCode == RESULT_CANCELED) {
// do nothing
}
diff --git a/main/src/cgeo/geocaching/connector/gc/GCConnector.java b/main/src/cgeo/geocaching/connector/gc/GCConnector.java
index c88f104..42ec663 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCConnector.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCConnector.java
@@ -2,7 +2,6 @@ package cgeo.geocaching.connector.gc;
import cgeo.geocaching.R;
import cgeo.geocaching.SearchResult;
-import cgeo.geocaching.Settings;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgeoapplication;
import cgeo.geocaching.connector.AbstractConnector;
@@ -107,7 +106,8 @@ public class GCConnector extends AbstractConnector implements ISearchByGeocode,
return searchResult;
}
- return searchResult.filterSearchResults(false, false, Settings.getCacheType());
+ // do not filter when searching for one specific cache
+ return searchResult;
}
@Override
diff --git a/main/src/cgeo/geocaching/connector/oc/OCApiConnector.java b/main/src/cgeo/geocaching/connector/oc/OCApiConnector.java
index 508aab4..17c961a 100644
--- a/main/src/cgeo/geocaching/connector/oc/OCApiConnector.java
+++ b/main/src/cgeo/geocaching/connector/oc/OCApiConnector.java
@@ -1,7 +1,6 @@
package cgeo.geocaching.connector.oc;
import cgeo.geocaching.SearchResult;
-import cgeo.geocaching.Settings;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.connector.capability.ISearchByGeocode;
import cgeo.geocaching.network.Parameters;
@@ -33,7 +32,6 @@ public class OCApiConnector extends OCConnector implements ISearchByGeocode {
if (cache == null) {
return null;
}
- final SearchResult searchResult = new SearchResult(cache);
- return searchResult.filterSearchResults(false, false, Settings.getCacheType());
+ return new SearchResult(cache);
}
}
diff --git a/main/src/cgeo/geocaching/connector/ox/OXConnector.java b/main/src/cgeo/geocaching/connector/ox/OXConnector.java
index 4c53361..38bb496 100644
--- a/main/src/cgeo/geocaching/connector/ox/OXConnector.java
+++ b/main/src/cgeo/geocaching/connector/ox/OXConnector.java
@@ -62,7 +62,6 @@ public class OXConnector extends AbstractConnector implements ISearchByCenter, I
if (caches == null) {
return null;
}
- final SearchResult searchResult = new SearchResult(caches);
- return searchResult.filterSearchResults(false, false, Settings.getCacheType());
+ return new SearchResult(caches);
}
}