aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgeoapplication.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2011-11-07 13:47:46 +0100
committerSamuel Tardieu <sam@rfc1149.net>2011-11-07 13:48:43 +0100
commitbfa22e15a4b66bef6f1bacbf90878f81696e0395 (patch)
treebe1c3ee90724e2c985f7a44ce0c8b8cad3bd0541 /main/src/cgeo/geocaching/cgeoapplication.java
parent739de1c562f4814c2883459823aa46aadf26d96c (diff)
downloadcgeo-bfa22e15a4b66bef6f1bacbf90878f81696e0395.zip
cgeo-bfa22e15a4b66bef6f1bacbf90878f81696e0395.tar.gz
cgeo-bfa22e15a4b66bef6f1bacbf90878f81696e0395.tar.bz2
Cleanup addSearch
Now, addSearch: - has only one version (the other one was only a proxy) - does not return anything - has no longer the search and newItem parameters - calls with a newItem==false parameter have been removed
Diffstat (limited to 'main/src/cgeo/geocaching/cgeoapplication.java')
-rw-r--r--main/src/cgeo/geocaching/cgeoapplication.java24
1 files changed, 6 insertions, 18 deletions
diff --git a/main/src/cgeo/geocaching/cgeoapplication.java b/main/src/cgeo/geocaching/cgeoapplication.java
index 7c93c47..8c31943 100644
--- a/main/src/cgeo/geocaching/cgeoapplication.java
+++ b/main/src/cgeo/geocaching/cgeoapplication.java
@@ -534,31 +534,19 @@ public class cgeoapplication extends Application {
search.addGeocode(geocode);
}
- public cgSearch addSearch(final cgSearch search, List<cgCache> cacheList, Boolean newItem, int reason) {
- if (search == null) {
- return null;
- }
-
- return addSearch(search, cacheList, newItem, reason);
- }
-
- public cgSearch addSearch(final cgSearch search, final List<cgCache> cacheList, final boolean newItem, final int reason) {
+ public void addSearch(final List<cgCache> cacheList, final int reason) {
if (CollectionUtils.isEmpty(cacheList)) {
- return null;
+ return;
}
if (storage == null) {
storage = new cgData(this);
}
- if (newItem) {
- // save only newly downloaded data
- for (final cgCache cache : cacheList) {
- cache.setReason(reason);
- storeWithMerge(cache, false);
- }
- }
- return search;
+ for (final cgCache cache : cacheList) {
+ cache.setReason(reason);
+ storeWithMerge(cache, false);
+ }
}
public boolean addCacheToSearch(cgSearch search, cgCache cache) {