aboutsummaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-06-10 23:40:00 +0200
committerfiaxh <git@lightrise.org>2020-06-10 23:40:00 +0200
commit0beb592c5a6a2767e11a892bdb5ac9bcc5283c38 (patch)
treebea2894d322472292590ec126dc1b52543a10a7e /main/src
parent50c55c7f55aff6622d242bdcf2b58d5f7956f28e (diff)
downloaddino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.tar.gz
dino-0beb592c5a6a2767e11a892bdb5ac9bcc5283c38.zip
Use sqlite UPSERT
Diffstat (limited to 'main/src')
-rw-r--r--main/src/ui/util/config.vala15
1 files changed, 12 insertions, 3 deletions
diff --git a/main/src/ui/util/config.vala b/main/src/ui/util/config.vala
index 4ca0d8a0..ce5a3c59 100644
--- a/main/src/ui/util/config.vala
+++ b/main/src/ui/util/config.vala
@@ -22,7 +22,10 @@ public class Config : Object {
get { return window_maximize_; }
set {
if (value == window_maximize_) return;
- db.settings.insert().or("REPLACE").value(db.settings.key, "window_maximized").value(db.settings.value, value.to_string()).perform();
+ db.settings.upsert()
+ .value(db.settings.key, "window_maximized", true)
+ .value(db.settings.value, value.to_string())
+ .perform();
window_maximize_ = value;
}
}
@@ -32,7 +35,10 @@ public class Config : Object {
get { return window_height_; }
set {
if (value == window_height_) return;
- db.settings.insert().or("REPLACE").value(db.settings.key, "window_height").value(db.settings.value, value.to_string()).perform();
+ db.settings.upsert()
+ .value(db.settings.key, "window_height", true)
+ .value(db.settings.value, value.to_string())
+ .perform();
window_height_ = value;
}
}
@@ -42,7 +48,10 @@ public class Config : Object {
get { return window_width_; }
set {
if (value == window_width_) return;
- db.settings.insert().or("REPLACE").value(db.settings.key, "window_width").value(db.settings.value, value.to_string()).perform();
+ db.settings.upsert()
+ .value(db.settings.key, "window_width", true)
+ .value(db.settings.value, value.to_string())
+ .perform();
window_width_ = value;
}
}