aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/SearchResult.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/SearchResult.java')
-rw-r--r--main/src/cgeo/geocaching/SearchResult.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/SearchResult.java b/main/src/cgeo/geocaching/SearchResult.java
index 12a2522..1916afd 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) {