From 2f951413303e10a80e540cacd0c6c282f8ce82cc Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sat, 16 Jun 2018 10:08:34 +0200 Subject: core: remove double definition of enum cloud_storage_status Remove cloud_storage_status from qmlprefs.h. usage to qPref:: enum cloud_storage_status is not used from C, but only from C++, and having the same structure defined multiple times is a maintenance challenge. Signed-off-by: Jan Iversen --- core/cloudstorage.cpp | 1 + core/settings/qPref.cpp | 13 ++++++------- core/settings/qPref.h | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'core') diff --git a/core/cloudstorage.cpp b/core/cloudstorage.cpp index 89e4ba553..68b81fbbf 100644 --- a/core/cloudstorage.cpp +++ b/core/cloudstorage.cpp @@ -2,6 +2,7 @@ #include "cloudstorage.h" #include "pref.h" #include "qthelper.h" +#include "settings/qPref.h" #include "core/subsurface-qt/SettingsObjectWrapper.h" #include diff --git a/core/settings/qPref.cpp b/core/settings/qPref.cpp index b703c1fcb..791ec44b8 100644 --- a/core/settings/qPref.cpp +++ b/core/settings/qPref.cpp @@ -2,17 +2,16 @@ #include "qPref_private.h" #include "qPref.h" - -qPref *qPref::m_instance = NULL; +qPref::qPref(QObject *parent) : + QObject(parent) +{ +} qPref *qPref::instance() { - if (!m_instance) - m_instance = new qPref; - return m_instance; +static qPref *self = new qPref; + return self; } - - void qPref::loadSync(bool doSync) { } diff --git a/core/settings/qPref.h b/core/settings/qPref.h index 4170e5e64..f312f328a 100644 --- a/core/settings/qPref.h +++ b/core/settings/qPref.h @@ -7,10 +7,10 @@ class qPref : public QObject { Q_OBJECT + Q_ENUMS(cloud_status); public: - qPref(QObject *parent = NULL) : QObject(parent) {}; - ~qPref() {}; + qPref(QObject *parent = NULL); static qPref *instance(); // Load/Sync local settings (disk) and struct preference @@ -19,7 +19,6 @@ public: public: private: - static qPref *m_instance; }; #endif -- cgit v1.2.3-70-g09d2