summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-04-03 23:31:28 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-04 09:29:45 -0700
commita89b36c661662346c6c8092bdd2cefebf8f58c8a (patch)
treea6b9e40f06b6ddca77b974e8e7218df2deae8458
parente9fa298d06bdeb267a7931f9b54cd82b3c1e3a1b (diff)
downloadsubsurface-a89b36c661662346c6c8092bdd2cefebf8f58c8a.tar.gz
Cleanup: don't instantiate a QPref object
QPref has only static functions. There seems to be no point in instantiating a singleton of this object. Remove the instance() method and remove the Q_OBJECT macro. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--core/settings/qPref.cpp11
-rw-r--r--core/settings/qPref.h7
2 files changed, 1 insertions, 17 deletions
diff --git a/core/settings/qPref.cpp b/core/settings/qPref.cpp
index 04a2615d3..4c4a7961c 100644
--- a/core/settings/qPref.cpp
+++ b/core/settings/qPref.cpp
@@ -18,16 +18,6 @@
#include <QtQml>
#include <QQmlContext>
-qPref::qPref(QObject *parent) : QObject(parent)
-{
-}
-
-qPref *qPref::instance()
-{
- static qPref *self = new qPref;
- return self;
-}
-
void qPref::loadSync(bool doSync)
{
if (!doSync)
@@ -58,7 +48,6 @@ void qPref::registerQML(QQmlEngine *engine)
if (engine) {
QQmlContext *ct = engine->rootContext();
- ct->setContextProperty("Pref", qPref::instance());
ct->setContextProperty("PrefCloudStorage", qPrefCloudStorage::instance());
ct->setContextProperty("PrefDisplay", qPrefDisplay::instance());
ct->setContextProperty("PrefDiveComputer", qPrefDiveComputer::instance());
diff --git a/core/settings/qPref.h b/core/settings/qPref.h
index 7628e1c4a..581efd883 100644
--- a/core/settings/qPref.h
+++ b/core/settings/qPref.h
@@ -6,13 +6,8 @@
#include <QObject>
#include <QQmlEngine>
-class qPref : public QObject {
- Q_OBJECT
-
+class qPref {
public:
- qPref(QObject *parent = NULL);
- static qPref *instance();
-
// Load/Sync local settings (disk) and struct preference
static void load() { loadSync(false); }
static void sync() { loadSync(true); }