diff options
Diffstat (limited to 'main/src/cgeo/geocaching/SearchResult.java')
| -rw-r--r-- | main/src/cgeo/geocaching/SearchResult.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/SearchResult.java b/main/src/cgeo/geocaching/SearchResult.java index 12a2522..2e8a3f6 100644 --- a/main/src/cgeo/geocaching/SearchResult.java +++ b/main/src/cgeo/geocaching/SearchResult.java @@ -11,7 +11,9 @@ import cgeo.geocaching.gcvote.GCVote; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; + import rx.Observable; import rx.functions.Func1; import rx.functions.Func2; @@ -60,6 +62,14 @@ public class SearchResult implements Parcelable { } /** + * Build a new empty search result with an error status. + */ + public SearchResult(final StatusCode statusCode) { + this(); + error = statusCode; + } + + /** * Copy a search result, for example to apply different filters on it. * * @param searchResult the original search result, which cannot be null @@ -155,6 +165,7 @@ public class SearchResult implements Parcelable { return 0; } + @NonNull public Set<String> getGeocodes() { return Collections.unmodifiableSet(geocodes); } @@ -218,7 +229,7 @@ public class SearchResult implements Parcelable { int excluded = 0; for (Geocache cache : caches) { // Is there any reason to exclude the cache from the list? - final boolean excludeCache = (excludeDisabled && cache.isDisabled()) || + final boolean excludeCache = (excludeDisabled && (cache.isDisabled() || cache.isArchived())) || (excludeMine && (cache.isOwner() || cache.isFound())) || (!cacheType.contains(cache)); if (excludeCache) { @@ -319,7 +330,7 @@ public class SearchResult implements Parcelable { searchResult.addSearchResult(searchResult2); return searchResult; } - }).toBlockingObservable().first(); + }).toBlocking().first(); } } |
