aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorBananeweizen <Bananeweizen@gmx.de>2012-08-26 08:42:43 +0200
committerBananeweizen <Bananeweizen@gmx.de>2012-08-26 08:42:43 +0200
commit40430ededc59e1a2744bcabd881692490be1c735 (patch)
treec2050ccefa7912c0222502f80fa0cf0466fecb54 /main/src
parent0167c767937d56deb611a72d92d2fb563fd347f2 (diff)
downloadcgeo-40430ededc59e1a2744bcabd881692490be1c735.zip
cgeo-40430ededc59e1a2744bcabd881692490be1c735.tar.gz
cgeo-40430ededc59e1a2744bcabd881692490be1c735.tar.bz2
#1974: change pull request as discussed
* use trim instead of deletewhitespace
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/SearchActivity.java2
-rw-r--r--main/src/cgeo/geocaching/connector/ConnectorFactory.java4
2 files changed, 4 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/SearchActivity.java b/main/src/cgeo/geocaching/SearchActivity.java
index e5cf679..638e509 100644
--- a/main/src/cgeo/geocaching/SearchActivity.java
+++ b/main/src/cgeo/geocaching/SearchActivity.java
@@ -103,7 +103,7 @@ public class SearchActivity extends AbstractActivity {
private boolean instantSearch(final String query, final boolean keywordSearch) {
// Check if any connector can handle the query as a geocode
- final String geocode = StringUtils.deleteWhitespace(query);
+ final String geocode = StringUtils.trim(query);
final IConnector connector = ConnectorFactory.getConnector(geocode);
if (connector instanceof ISearchByGeocode) {
final Intent cachesIntent = new Intent(this, CacheDetailActivity.class);
diff --git a/main/src/cgeo/geocaching/connector/ConnectorFactory.java b/main/src/cgeo/geocaching/connector/ConnectorFactory.java
index 784a54e..6b3afe9 100644
--- a/main/src/cgeo/geocaching/connector/ConnectorFactory.java
+++ b/main/src/cgeo/geocaching/connector/ConnectorFactory.java
@@ -50,7 +50,9 @@ public final class ConnectorFactory {
return getConnector(cache.getGeocode());
}
- public static IConnector getConnector(String geocode) {
+ public static IConnector getConnector(final String geocodeInput) {
+ // this may come from user input
+ final String geocode = StringUtils.trim(geocodeInput);
if (isInvalidGeocode(geocode)) {
return UNKNOWN_CONNECTOR;
}