diff options
author | Bananeweizen <Bananeweizen@gmx.de> | 2012-08-26 08:42:43 +0200 |
---|---|---|
committer | Bananeweizen <Bananeweizen@gmx.de> | 2012-08-26 08:42:43 +0200 |
commit | 40430ededc59e1a2744bcabd881692490be1c735 (patch) | |
tree | c2050ccefa7912c0222502f80fa0cf0466fecb54 /main/src | |
parent | 0167c767937d56deb611a72d92d2fb563fd347f2 (diff) | |
download | cgeo-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.java | 2 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/connector/ConnectorFactory.java | 4 |
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; } |