diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2012-11-28 22:02:37 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2012-11-28 22:02:37 +0100 |
| commit | d16aab94d82b6241e6b2d5749d49fc1ef1e53283 (patch) | |
| tree | 34cdc5c181a3054b369f847cd7563155a2d2059e /main/src/cgeo/geocaching/cgeoapplication.java | |
| parent | 76c87d3c53c0e9a78c1f1d5d3912f4dcf3955023 (diff) | |
| download | cgeo-d16aab94d82b6241e6b2d5749d49fc1ef1e53283.zip cgeo-d16aab94d82b6241e6b2d5749d49fc1ef1e53283.tar.gz cgeo-d16aab94d82b6241e6b2d5749d49fc1ef1e53283.tar.bz2 | |
refactoring: use more prepared statements
* improves database performance
* removed some method arguments which were always true
Diffstat (limited to 'main/src/cgeo/geocaching/cgeoapplication.java')
| -rw-r--r-- | main/src/cgeo/geocaching/cgeoapplication.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/main/src/cgeo/geocaching/cgeoapplication.java b/main/src/cgeo/geocaching/cgeoapplication.java index 9e221cd..c866739 100644 --- a/main/src/cgeo/geocaching/cgeoapplication.java +++ b/main/src/cgeo/geocaching/cgeoapplication.java @@ -275,10 +275,10 @@ public class cgeoapplication extends Application { return storage.getBounds(geocodes); } - /** {@link cgData#loadBatchOfStoredGeocodes(boolean, Geopoint, CacheType, int)} */ - public SearchResult getBatchOfStoredCaches(final boolean detailedOnly, final Geopoint coords, final CacheType cacheType, final int listId) { - final Set<String> geocodes = storage.loadBatchOfStoredGeocodes(detailedOnly, coords, cacheType, listId); - return new SearchResult(geocodes, getAllStoredCachesCount(true, cacheType, listId)); + /** {@link cgData#loadBatchOfStoredGeocodes(Geopoint, CacheType, int)} */ + public SearchResult getBatchOfStoredCaches(final Geopoint coords, final CacheType cacheType, final int listId) { + final Set<String> geocodes = storage.loadBatchOfStoredGeocodes(coords, cacheType, listId); + return new SearchResult(geocodes, getAllStoredCachesCount(cacheType, listId)); } /** {@link cgData#loadHistoryOfSearchedLocations()} */ @@ -303,19 +303,14 @@ public class cgeoapplication extends Application { return new SearchResult(geocodes); } - /** {@link cgData#getAllStoredCachesCount(boolean, CacheType, int)} */ - public int getAllStoredCachesCount(final boolean detailedOnly, final CacheType cacheType) { - return storage.getAllStoredCachesCount(detailedOnly, cacheType, 0); + /** {@link cgData#getAllStoredCachesCount(CacheType, int)} */ + public int getAllStoredCachesCount(final CacheType cacheType, final Integer list) { + return storage.getAllStoredCachesCount(cacheType, list); } - /** {@link cgData#getAllStoredCachesCount(boolean, CacheType, int)} */ - public int getAllStoredCachesCount(final boolean detailedOnly, final CacheType cacheType, final Integer list) { - return storage.getAllStoredCachesCount(detailedOnly, cacheType, list); - } - - /** {@link cgData#getAllHistoricCachesCount()} */ + /** {@link cgData#getAllHistoryCachesCount()} */ public int getAllHistoricCachesCount() { - return storage.getAllHistoricCachesCount(); + return storage.getAllHistoryCachesCount(); } /** {@link cgData#moveToList(List, int)} */ @@ -501,4 +496,8 @@ public class cgeoapplication extends Application { return storage.loadWaypoints(geocode); } + public static int getAllCachesCount() { + return cgData.getAllCachesCount(); + } + } |
