summaryrefslogtreecommitdiffstats
path: root/core/settings/qPrefPrivate.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-17 15:22:51 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-18 10:40:08 -0700
commit3c3729711c86a621b425370fd11d4271e4208f1b (patch)
tree6d689f6b3ce4e24997d1a79e63e3039eef8c7642 /core/settings/qPrefPrivate.cpp
parentc0e9e978a1aa70713f9478391ebde353708a2f07 (diff)
downloadsubsurface-3c3729711c86a621b425370fd11d4271e4208f1b.tar.gz
core: remove QSettings in qPref* and use a shared variable
Add qPrefPrivate class which contains one QSettings variable, delete QSettings from qPref* class definitions this secures there are only instance of QSettings (QSettings needs to be in a QObject class to work) Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/settings/qPrefPrivate.cpp')
-rw-r--r--core/settings/qPrefPrivate.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/settings/qPrefPrivate.cpp b/core/settings/qPrefPrivate.cpp
new file mode 100644
index 000000000..53b99c4e5
--- /dev/null
+++ b/core/settings/qPrefPrivate.cpp
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "qPrefPrivate.h"
+
+qPrefPrivate::qPrefPrivate(QObject *parent) : QObject(parent)
+{
+}
+qPrefPrivate *qPrefPrivate::instance()
+{
+ static qPrefPrivate *self = new qPrefPrivate;
+ return self;
+}