summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlprefs.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-09-27 16:26:54 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-09-27 16:26:58 -0700
commit9ae7040a91c3e3e0606d7abe085ef6da47efd6d2 (patch)
treede120b115df95fb96d945581aca41cd8c760263c /mobile-widgets/qmlprefs.cpp
parent400b218f769320221567b7b66f39c33126a7d2e1 (diff)
downloadsubsurface-9ae7040a91c3e3e0606d7abe085ef6da47efd6d2.tar.gz
Revert the singleton PR
It turns out that this isn't working the way it was intended to. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlprefs.cpp')
-rw-r--r--mobile-widgets/qmlprefs.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/mobile-widgets/qmlprefs.cpp b/mobile-widgets/qmlprefs.cpp
index e415c0e5d..cf7b5ddbb 100644
--- a/mobile-widgets/qmlprefs.cpp
+++ b/mobile-widgets/qmlprefs.cpp
@@ -8,13 +8,30 @@
/*** Global and constructors ***/
+QMLPrefs *QMLPrefs::m_instance = NULL;
+
QMLPrefs::QMLPrefs() :
m_credentialStatus(qPrefCloudStorage::CS_UNKNOWN),
m_oldStatus(qPrefCloudStorage::CS_UNKNOWN),
m_showPin(false)
{
+ // This strange construct is needed because QMLEngine calls new and that
+ // cannot be overwritten
+ if (!m_instance)
+ m_instance = this;
+}
+
+QMLPrefs::~QMLPrefs()
+{
+ m_instance = NULL;
}
+QMLPrefs *QMLPrefs::instance()
+{
+ return m_instance;
+}
+
+
/*** public functions ***/
const QString QMLPrefs::cloudPassword() const
{