aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgData.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2011-11-23 08:09:00 +0100
committerBananeweizen <bananeweizen@gmx.de>2011-11-23 08:09:00 +0100
commitd86925ca0efc051259a35f917753080868614f0f (patch)
tree9e4828f054123b57d130eed57e421c1cc9911287 /main/src/cgeo/geocaching/cgData.java
parent924af5f8ad2afa2f7ef2d69599944e7bf6b71a9c (diff)
parent4226ec4247f122a875539c55fcb147a81bce5780 (diff)
downloadcgeo-d86925ca0efc051259a35f917753080868614f0f.zip
cgeo-d86925ca0efc051259a35f917753080868614f0f.tar.gz
cgeo-d86925ca0efc051259a35f917753080868614f0f.tar.bz2
Merge remote branch 'blafoo/cachetype'
Conflicts: main/src/cgeo/geocaching/cgBase.java main/src/cgeo/geocaching/cgeocaches.java main/src/cgeo/geocaching/filter/cgFilterByType.java main/src/cgeo/geocaching/maps/CachesOverlay.java
Diffstat (limited to 'main/src/cgeo/geocaching/cgData.java')
-rw-r--r--main/src/cgeo/geocaching/cgData.java42
1 files changed, 21 insertions, 21 deletions
diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java
index 87c6a97..715ebed 100644
--- a/main/src/cgeo/geocaching/cgData.java
+++ b/main/src/cgeo/geocaching/cgData.java
@@ -1233,7 +1233,7 @@ public class cgData {
values.put("geocode", cache.getGeocode());
values.put("cacheid", cache.getCacheId());
values.put("guid", cache.getGuid());
- values.put("type", cache.getCacheType().id);
+ values.put("type", cache.getType().id);
values.put("name", cache.getName());
values.put("own", cache.isOwn() ? 1 : 0);
values.put("owner", cache.getOwner());
@@ -2063,7 +2063,7 @@ public class cgData {
cache.setGeocode(cursor.getString(cacheColumnIndex[5]));
cache.setCacheId(cursor.getString(cacheColumnIndex[6]));
cache.setGuid(cursor.getString(cacheColumnIndex[7]));
- cache.setCacheType(CacheType.getById(cursor.getString(cacheColumnIndex[8])));
+ cache.setType(CacheType.getById(cursor.getString(cacheColumnIndex[8])));
cache.setName(cursor.getString(cacheColumnIndex[9]));
cache.setOwn(cursor.getInt(cacheColumnIndex[10]) == 1);
cache.setOwner(cursor.getString(cacheColumnIndex[11]));
@@ -2073,7 +2073,7 @@ public class cgData {
cache.setHidden(new Date(dateValue));
}
cache.setHint(cursor.getString(cacheColumnIndex[14]));
- cache.setSize(CacheSize.FIND_BY_ID.get(cursor.getString(cacheColumnIndex[15])));
+ cache.setSize(CacheSize.getById(cursor.getString(cacheColumnIndex[15])));
cache.setDifficulty(cursor.getFloat(cacheColumnIndex[16]));
index = cacheColumnIndex[17];
if (cursor.isNull(index)) {
@@ -2536,13 +2536,13 @@ public class cgData {
try {
String sql = "select count(_id) from " + dbTableCaches; // this default is not used, but we like to have variables initialized
if (!detailedOnly) {
- if (cacheType == null) {
+ if (cacheType == CacheType.ALL) {
sql = "select count(_id) from " + dbTableCaches + listSql;
} else {
sql = "select count(_id) from " + dbTableCaches + " where type = \"" + cacheType.id + "\"" + listSqlW;
}
} else {
- if (cacheType == null) {
+ if (cacheType == CacheType.ALL) {
sql = "select count(_id) from " + dbTableCaches + " where detailed = 1" + listSqlW;
} else {
sql = "select count(_id) from " + dbTableCaches + " where detailed = 1 and type = \"" + cacheType.id + "\"" + listSqlW;
@@ -2588,7 +2588,7 @@ public class cgData {
specifySql.append(" and detailed = 1 ");
}
- if (cacheType != null) {
+ if (cacheType != CacheType.ALL) {
specifySql.append(" and type = \"");
specifySql.append(cacheType.id);
specifySql.append('"');
@@ -2629,7 +2629,7 @@ public class cgData {
return geocodes;
}
- public List<String> loadBatchOfHistoricGeocodes(final boolean detailedOnly, final CacheType cachetype) {
+ public List<String> loadBatchOfHistoricGeocodes(final boolean detailedOnly, final CacheType cacheType) {
init();
List<String> geocodes = new ArrayList<String>();
@@ -2640,9 +2640,9 @@ public class cgData {
if (detailedOnly) {
specifySql.append(" and detailed = 1");
}
- if (cachetype != null) {
+ if (cacheType != CacheType.ALL) {
specifySql.append(" and type = \"");
- specifySql.append(cachetype.id);
+ specifySql.append(cacheType.id);
specifySql.append('"');
}
@@ -2679,15 +2679,15 @@ public class cgData {
return geocodes;
}
- public List<String> getCachedInViewport(final Long centerLat, final Long centerLon, final Long spanLat, final Long spanLon, final CacheType cachetype) {
- return getInViewport(false, centerLat, centerLon, spanLat, spanLon, cachetype);
+ public List<String> getCachedInViewport(final Long centerLat, final Long centerLon, final Long spanLat, final Long spanLon, final CacheType cacheType) {
+ return getInViewport(false, centerLat, centerLon, spanLat, spanLon, cacheType);
}
- public List<String> getStoredInViewport(final Long centerLat, final Long centerLon, final Long spanLat, final Long spanLon, final CacheType cachetype) {
- return getInViewport(true, centerLat, centerLon, spanLat, spanLon, cachetype);
+ public List<String> getStoredInViewport(final Long centerLat, final Long centerLon, final Long spanLat, final Long spanLon, final CacheType cacheType) {
+ return getInViewport(true, centerLat, centerLon, spanLat, spanLon, cacheType);
}
- public List<String> getInViewport(final boolean stored, final Long centerLat, final Long centerLon, final Long spanLat, final Long spanLon, final CacheType cachetype) {
+ public List<String> getInViewport(final boolean stored, final Long centerLat, final Long centerLon, final Long spanLat, final Long spanLon, final CacheType cacheType) {
if (centerLat == null || centerLon == null || spanLat == null || spanLon == null) {
return null;
}
@@ -2724,10 +2724,10 @@ public class cgData {
where.append(" and longitude <= ");
where.append(String.format((Locale) null, "%.6f", lonMax));
- // cachetype limitation
- if (cachetype != null) {
+ // cacheType limitation
+ if (cacheType != CacheType.ALL) {
where.append(" and type = \"");
- where.append(cachetype.id);
+ where.append(cacheType.id);
where.append('"');
}
@@ -2769,16 +2769,16 @@ public class cgData {
return geocodes;
}
- public List<String> getOfflineAll(String cachetype) {
+ public List<String> getOfflineAll(CacheType cacheType) {
init();
List<String> geocodes = new ArrayList<String>();
StringBuilder where = new StringBuilder();
- // cachetype limitation
- if (cachetype != null) {
- where.append(cachetype);
+ // cacheType limitation
+ if (cacheType != CacheType.ALL) {
+ where.append(cacheType);
where.append('"');
}