diff options
author | Portree-Kid <keith.paterson@gmx.de> | 2012-07-19 20:16:44 +0200 |
---|---|---|
committer | Portree-Kid <keith.paterson@gmx.de> | 2012-07-19 20:16:44 +0200 |
commit | 907a797d8980893659fdc9fdae5d6419d09be7f1 (patch) | |
tree | 360b81cc72512509c67f650ef6d2608335b7e8b6 /main/src/cgeo/geocaching/cgData.java | |
parent | 9875e2b489a6a7fa3c2067d747a8c1edb6925b60 (diff) | |
download | cgeo-907a797d8980893659fdc9fdae5d6419d09be7f1.zip cgeo-907a797d8980893659fdc9fdae5d6419d09be7f1.tar.gz cgeo-907a797d8980893659fdc9fdae5d6419d09be7f1.tar.bz2 |
Added Filter to loading of waypoints fixes 1866
Diffstat (limited to 'main/src/cgeo/geocaching/cgData.java')
-rw-r--r-- | main/src/cgeo/geocaching/cgData.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java index f219835..af66079 100644 --- a/main/src/cgeo/geocaching/cgData.java +++ b/main/src/cgeo/geocaching/cgData.java @@ -66,7 +66,7 @@ public class cgData { private static final String[] WAYPOINT_COLUMNS = new String[] { "_id", "geocode", "updated", "type", "prefix", "lookup", "name", "latlon", "latitude", "longitude", "note", "own" }; /** Number of days (as ms) after temporarily saved caches are deleted */ - private static long DAYS_AFTER_CACHE_IS_DELETED = 3 * 24 * 60 * 60 * 1000; + private final static long DAYS_AFTER_CACHE_IS_DELETED = 3 * 24 * 60 * 60 * 1000; /** * holds the column indexes of the cache table to avoid lookups @@ -2929,10 +2929,11 @@ public class cgData { * * @param excludeDisabled * @param excludeMine + * @param type * @return */ - public Set<cgWaypoint> loadWaypoints(final Viewport viewport, boolean excludeMine, boolean excludeDisabled) { + public Set<cgWaypoint> loadWaypoints(final Viewport viewport, boolean excludeMine, boolean excludeDisabled, CacheType type) { final StringBuilder where = new StringBuilder(buildCoordinateWhere(dbTableWaypoints, viewport)); if (excludeMine) { where.append(" and ").append(dbTableCaches).append(".own == 0 and ").append(dbTableCaches).append(".found == 0"); @@ -2940,6 +2941,9 @@ public class cgData { if (excludeDisabled) { where.append(" and ").append(dbTableCaches).append(".disabled == 0"); } + if (type != CacheType.ALL) { + where.append(" and ").append(dbTableCaches).append(".type == '" + type.id + "'"); + } init(); final StringBuilder query = new StringBuilder("SELECT "); |