aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/database.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-08-21 17:16:25 +0200
committerfiaxh <git@mx.ax.lt>2017-08-22 16:22:56 +0200
commit4a4b5956c9b12bbfb583da1794ef0184e760ac33 (patch)
tree05a8581e46cc839e3064e5978e0708ad37a056db /libdino/src/service/database.vala
parenta8aceb1e395e3d0d5a570f6570a1613e2f990d87 (diff)
downloaddino-4a4b5956c9b12bbfb583da1794ef0184e760ac33.tar.gz
dino-4a4b5956c9b12bbfb583da1794ef0184e760ac33.zip
Move settings from GSettings to own db
Diffstat (limited to 'libdino/src/service/database.vala')
-rw-r--r--libdino/src/service/database.vala17
1 files changed, 15 insertions, 2 deletions
diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala
index 5a7eb46d..91a62cce 100644
--- a/libdino/src/service/database.vala
+++ b/libdino/src/service/database.vala
@@ -6,7 +6,7 @@ using Dino.Entities;
namespace Dino {
public class Database : Qlite.Database {
- private const int VERSION = 4;
+ private const int VERSION = 5;
public class AccountTable : Table {
public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true };
@@ -133,6 +133,17 @@ public class Database : Qlite.Database {
}
}
+ public class SettingsTable : Table {
+ public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true };
+ public Column<string> key = new Column.Text("key") { unique = true, not_null = true };
+ public Column<string> value = new Column.Text("value");
+
+ internal SettingsTable(Database db) {
+ base(db, "settings");
+ init({id, key, value});
+ }
+ }
+
public AccountTable account { get; private set; }
public JidTable jid { get; private set; }
public MessageTable message { get; private set; }
@@ -141,6 +152,7 @@ public class Database : Qlite.Database {
public AvatarTable avatar { get; private set; }
public EntityFeatureTable entity_feature { get; private set; }
public RosterTable roster { get; private set; }
+ public SettingsTable settings { get; private set; }
public Map<int, string> jid_table_cache = new HashMap<int, string>();
public Map<string, int> jid_table_reverse = new HashMap<string, int>();
@@ -156,7 +168,8 @@ public class Database : Qlite.Database {
avatar = new AvatarTable(this);
entity_feature = new EntityFeatureTable(this);
roster = new RosterTable(this);
- init({ account, jid, message, real_jid, conversation, avatar, entity_feature, roster });
+ settings = new SettingsTable(this);
+ init({ account, jid, message, real_jid, conversation, avatar, entity_feature, roster, settings });
exec("PRAGMA synchronous=0");
}