summaryrefslogtreecommitdiff
path: root/src/config.cpp
diff options
context:
space:
mode:
authorThorsten Wißmann <edu@thorsten-wissmann.de>2015-09-22 15:31:13 +0200
committerPhilipp Erhardt <Philipp.Erhardt@informatik.stud.uni-erlangen.de>2015-09-25 18:14:34 +0200
commit5b895508831418de29418e184ae720488c111b5c (patch)
tree20fcf06a20c052b9445f12cc5927cb2a7d6a123d /src/config.cpp
parent914be0e85c5bac1078eff3448bd16d5e243f6ab1 (diff)
Add single instance per file mode
This introduces the setting single_instance_per_file and the command line flag --single-instance.
Diffstat (limited to 'src/config.cpp')
-rw-r--r--src/config.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config.cpp b/src/config.cpp
index 950dc1a..ad8f7d1 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -29,6 +29,7 @@ CFG::CFG() :
defaults["rect_expansion"] = 2;
// viewer options
defaults["quit_on_init_fail"] = false;
+ defaults["single_instance_per_file"] = false;
defaults["icon_theme"] = "";
// mouse buttons
@@ -145,6 +146,14 @@ bool CFG::has_tmp_value(const char *key) const {
return tmp_values.contains(key);
}
+QVariant CFG::get_most_current_value(const char *key) const {
+ if (tmp_values.contains(key)) {
+ return tmp_values[key];
+ } else {
+ return settings.value(QString("Settings/") + key, defaults[key]);
+ }
+}
+
QStringList CFG::get_keys(const char *action) const {
return settings.value(QString("Keys/") + action, keys[action]).toStringList();
}