diff options
Diffstat (limited to 'mobile-widgets/qmlprefs.cpp')
-rw-r--r-- | mobile-widgets/qmlprefs.cpp | 17 |
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 { |