aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/org/connectbot/util
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2015-03-27 19:18:22 +0000
committerKenny Root <kenny@the-b.org>2015-03-27 19:18:22 +0000
commit9220444f0aeea673bb164b02d9fecca210e8ade4 (patch)
tree7de5bea191887ed0a7d13424ff1788de0de19903 /app/src/main/java/org/connectbot/util
parentd05cbcb369f0d0f6be587789f7b5925a7f51553a (diff)
parent582524f7bfa91f575bb6536f90789f674138f2f5 (diff)
downloadconnectbot-9220444f0aeea673bb164b02d9fecca210e8ade4.tar.gz
connectbot-9220444f0aeea673bb164b02d9fecca210e8ade4.tar.bz2
connectbot-9220444f0aeea673bb164b02d9fecca210e8ade4.zip
Merge branch 'master' into gradle-conversion
Diffstat (limited to 'app/src/main/java/org/connectbot/util')
-rw-r--r--app/src/main/java/org/connectbot/util/HostDatabase.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/src/main/java/org/connectbot/util/HostDatabase.java b/app/src/main/java/org/connectbot/util/HostDatabase.java
index 1d31f6b..cc0fd0c 100644
--- a/app/src/main/java/org/connectbot/util/HostDatabase.java
+++ b/app/src/main/java/org/connectbot/util/HostDatabase.java
@@ -47,7 +47,7 @@ public class HostDatabase extends RobustSQLiteOpenHelper {
public final static String TAG = "ConnectBot.HostDatabase";
public final static String DB_NAME = "hosts";
- public final static int DB_VERSION = 22;
+ public final static int DB_VERSION = 23;
public final static String TABLE_HOSTS = "hosts";
public final static String FIELD_HOST_NICKNAME = "nickname";
@@ -69,6 +69,7 @@ public class HostDatabase extends RobustSQLiteOpenHelper {
public final static String FIELD_HOST_COMPRESSION = "compression";
public final static String FIELD_HOST_ENCODING = "encoding";
public final static String FIELD_HOST_STAYCONNECTED = "stayconnected";
+ public final static String FIELD_HOST_QUICKDISCONNECT = "quickdisconnect";
public final static String TABLE_PORTFORWARDS = "portforwards";
public final static String FIELD_PORTFORWARD_HOSTID = "hostid";
@@ -169,7 +170,8 @@ public class HostDatabase extends RobustSQLiteOpenHelper {
+ FIELD_HOST_WANTSESSION + " TEXT DEFAULT '" + Boolean.toString(true) + "', "
+ FIELD_HOST_COMPRESSION + " TEXT DEFAULT '" + Boolean.toString(false) + "', "
+ FIELD_HOST_ENCODING + " TEXT DEFAULT '" + ENCODING_DEFAULT + "', "
- + FIELD_HOST_STAYCONNECTED + " TEXT)");
+ + FIELD_HOST_STAYCONNECTED + " TEXT, "
+ + FIELD_HOST_QUICKDISCONNECT + " TEXT DEFAULT '" + Boolean.toString(false) + "')");
db.execSQL("CREATE TABLE " + TABLE_PORTFORWARDS
+ " (_id INTEGER PRIMARY KEY, "
@@ -259,6 +261,9 @@ public class HostDatabase extends RobustSQLiteOpenHelper {
db.execSQL("DROP TABLE " + TABLE_COLOR_DEFAULTS);
db.execSQL(CREATE_TABLE_COLOR_DEFAULTS);
db.execSQL(CREATE_TABLE_COLOR_DEFAULTS_INDEX);
+ case 22:
+ db.execSQL("ALTER TABLE " + TABLE_HOSTS
+ + " ADD COLUMN " + FIELD_HOST_QUICKDISCONNECT + " TEXT DEFAULT '" + Boolean.toString(false) + "'");
}
}
@@ -376,8 +381,8 @@ public class HostDatabase extends RobustSQLiteOpenHelper {
COL_FONTSIZE = c.getColumnIndexOrThrow(FIELD_HOST_FONTSIZE),
COL_COMPRESSION = c.getColumnIndexOrThrow(FIELD_HOST_COMPRESSION),
COL_ENCODING = c.getColumnIndexOrThrow(FIELD_HOST_ENCODING),
- COL_STAYCONNECTED = c.getColumnIndexOrThrow(FIELD_HOST_STAYCONNECTED);
-
+ COL_STAYCONNECTED = c.getColumnIndexOrThrow(FIELD_HOST_STAYCONNECTED),
+ COL_QUICKDISCONNECT = c.getColumnIndexOrThrow(FIELD_HOST_QUICKDISCONNECT);
while (c.moveToNext()) {
HostBean host = new HostBean();
@@ -400,6 +405,7 @@ public class HostDatabase extends RobustSQLiteOpenHelper {
host.setCompression(Boolean.valueOf(c.getString(COL_COMPRESSION)));
host.setEncoding(c.getString(COL_ENCODING));
host.setStayConnected(Boolean.valueOf(c.getString(COL_STAYCONNECTED)));
+ host.setQuickDisconnect(Boolean.valueOf(c.getString(COL_QUICKDISCONNECT)));
hosts.add(host);
}