aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-06-03 16:15:34 +0200
committerBananeweizen <bananeweizen@gmx.de>2012-06-03 16:15:34 +0200
commit7297933b1c5cfe1b00474824f5cbb3a7a176d5a2 (patch)
tree4be8c300d6ba20cd704fd51aaebc3a8855566fb8
parent2b70b0a6f5b83d40928e2e104f62b1d47b9b7f17 (diff)
downloadcgeo-7297933b1c5cfe1b00474824f5cbb3a7a176d5a2.zip
cgeo-7297933b1c5cfe1b00474824f5cbb3a7a176d5a2.tar.gz
cgeo-7297933b1c5cfe1b00474824f5cbb3a7a176d5a2.tar.bz2
fix #1704: Filter applied to single cache request
-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 bb01cf1..5bf728f 100644
--- a/main/src/cgeo/geocaching/cgeo.java
+++ b/main/src/cgeo/geocaching/cgeo.java
@@ -390,12 +390,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);
}
}