aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgData.java
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2013-06-27 17:46:41 +0200
committerrsudev <rasch@munin-soft.de>2013-06-27 17:46:41 +0200
commitdc53fa7be33f3052e39952112679c7b0e0b3b324 (patch)
tree6fef9b63070a08177a13401e90de8916c4a72e91 /main/src/cgeo/geocaching/cgData.java
parentcb90fff0100a40bdefae6b57a6b12e9c113b641f (diff)
downloadcgeo-dc53fa7be33f3052e39952112679c7b0e0b3b324.zip
cgeo-dc53fa7be33f3052e39952112679c7b0e0b3b324.tar.gz
cgeo-dc53fa7be33f3052e39952112679c7b0e0b3b324.tar.bz2
Implements #2900, Support logging with password (oc)
Extends db, geocache and OKAPI to retrieve and store the property Extends logging UI and OKAPI to allow entering and sending it
Diffstat (limited to 'main/src/cgeo/geocaching/cgData.java')
-rw-r--r--main/src/cgeo/geocaching/cgData.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java
index 2ef5b27..6f535dc 100644
--- a/main/src/cgeo/geocaching/cgData.java
+++ b/main/src/cgeo/geocaching/cgData.java
@@ -67,8 +67,8 @@ public class cgData {
"difficulty", "direction", "distance", "terrain", "latlon", "location", "elevation", "personal_note", "shortdesc",
// 24 25 26 27 28 29 30 31 32
"favourite_cnt", "rating", "votes", "myvote", "disabled", "archived", "members", "found", "favourite",
- // 33 34 35 36 37 38 39 40 41 42
- "inventoryunknown", "onWatchlist", "reliable_latlon", "coordsChanged", "latitude", "longitude", "finalDefined", "_id", "inventorycoins", "inventorytags"
+ // 33 34 35 36 37 38 39 40 41 42 43
+ "inventoryunknown", "onWatchlist", "reliable_latlon", "coordsChanged", "latitude", "longitude", "finalDefined", "_id", "inventorycoins", "inventorytags", "logPasswordRequired"
// reason is replaced by listId in Geocache
};
@@ -86,7 +86,7 @@ public class cgData {
private static int[] cacheColumnIndex;
private static CacheCache cacheCache = new CacheCache();
private static SQLiteDatabase database = null;
- private static final int dbVersion = 67;
+ private static final int dbVersion = 68;
public static final int customListIdOffset = 10;
private static final String dbName = "data";
private static final String dbTableCaches = "cg_caches";
@@ -146,6 +146,7 @@ public class cgData {
+ "onWatchlist integer default 0, "
+ "coordsChanged integer default 0, "
+ "finalDefined integer default 0"
+ + "logPasswordRequired integer default 0"
+ "); ";
private static final String dbCreateLists = ""
+ "create table " + dbTableLists + " ("
@@ -685,6 +686,15 @@ public class cgData {
}
}
+ // Introduces logPasswordRequired on caches
+ if (oldVersion < 68) {
+ try {
+ db.execSQL("alter table " + dbTableCaches + " add column logPasswordRequired integer default 0");
+ } catch (Exception e) {
+ Log.e("Failed to upgrade to ver. 68", e);
+
+ }
+ }
}
db.setTransactionSuccessful();
@@ -1052,6 +1062,7 @@ public class cgData {
values.put("onWatchlist", cache.isOnWatchlist() ? 1 : 0);
values.put("coordsChanged", cache.hasUserModifiedCoords() ? 1 : 0);
values.put("finalDefined", cache.hasFinalDefined() ? 1 : 0);
+ values.put("logPasswordRequired", cache.isLogPasswordRequired() ? 1 : 0);
init();
@@ -1643,6 +1654,7 @@ public class cgData {
cache.setReliableLatLon(cursor.getInt(cacheColumnIndex[35]) > 0);
cache.setUserModifiedCoords(cursor.getInt(cacheColumnIndex[36]) > 0);
cache.setFinalDefined(cursor.getInt(cacheColumnIndex[39]) > 0);
+ cache.setLogPasswordRequired(cursor.getInt(cacheColumnIndex[43]) > 0);
Log.d("Loading " + cache.toString() + " (" + cache.getListId() + ") from DB");