aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/ui
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-04-23 07:50:26 +0200
committerBananeweizen <bananeweizen@gmx.de>2012-04-23 07:50:26 +0200
commitd2fba594dfea96b17ab01bb12afbc37ec10fe251 (patch)
tree2e272eae1a0eeadc9213e8059f8f1d6dc381e048 /main/src/cgeo/geocaching/ui
parent0d19a993a9d2e99bd4f0627d182870ee1606cb91 (diff)
downloadcgeo-d2fba594dfea96b17ab01bb12afbc37ec10fe251.zip
cgeo-d2fba594dfea96b17ab01bb12afbc37ec10fe251.tar.gz
cgeo-d2fba594dfea96b17ab01bb12afbc37ec10fe251.tar.bz2
refactoring of database access
* use only one transaction when saving a cache * rework some methods to always take a collection of objects instead of calling the database multiple times
Diffstat (limited to 'main/src/cgeo/geocaching/ui')
-rw-r--r--main/src/cgeo/geocaching/ui/CacheListAdapter.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/ui/CacheListAdapter.java b/main/src/cgeo/geocaching/ui/CacheListAdapter.java
index 2735a94..9f2d69d 100644
--- a/main/src/cgeo/geocaching/ui/CacheListAdapter.java
+++ b/main/src/cgeo/geocaching/ui/CacheListAdapter.java
@@ -856,4 +856,17 @@ public class CacheListAdapter extends ArrayAdapter<cgCache> {
public List<cgCache> getFilteredList() {
return list;
}
+
+ public List<cgCache> getCheckedCaches() {
+ ArrayList<cgCache> result = new ArrayList<cgCache>();
+ int checked = getChecked();
+ if (checked > 0) {
+ for (cgCache cache : list) {
+ if (cache.isStatusChecked()) {
+ result.add(cache);
+ }
+ }
+ }
+ return result;
+ }
}