diff options
Diffstat (limited to 'main/src/cgeo/geocaching/loaders/FinderGeocacheListLoader.java')
| -rw-r--r-- | main/src/cgeo/geocaching/loaders/FinderGeocacheListLoader.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/main/src/cgeo/geocaching/loaders/FinderGeocacheListLoader.java b/main/src/cgeo/geocaching/loaders/FinderGeocacheListLoader.java index 7edd436..378fa1b 100644 --- a/main/src/cgeo/geocaching/loaders/FinderGeocacheListLoader.java +++ b/main/src/cgeo/geocaching/loaders/FinderGeocacheListLoader.java @@ -5,6 +5,7 @@ import cgeo.geocaching.connector.ConnectorFactory; import cgeo.geocaching.connector.capability.ISearchByFinder; import org.eclipse.jdt.annotation.NonNull; +import rx.functions.Func1; import android.content.Context; @@ -19,15 +20,13 @@ public class FinderGeocacheListLoader extends AbstractSearchLoader { @Override public SearchResult runSearch() { - SearchResult searchResult = new SearchResult(); - - for (ISearchByFinder connector : ConnectorFactory.getSearchByFinderConnectors()) { - if (connector.isActive()) { - searchResult.addSearchResult(connector.searchByFinder(username, this)); - } - } - - return searchResult; + return SearchResult.parallelCombineActive(ConnectorFactory.getSearchByFinderConnectors(), + new Func1<ISearchByFinder, SearchResult>() { + @Override + public SearchResult call(final ISearchByFinder connector) { + return connector.searchByFinder(username, FinderGeocacheListLoader.this); + } + }); } } |
