summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-06-12 10:29:40 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-15 14:12:14 -0700
commitd0e9f626245e7833847ad25ae3b97c5ab87caccb (patch)
treeac760a0ae3134613db39b20dd2276dc52c2d8052 /mobile-widgets
parent54db1309a0896aa3615956e20a89bb71053a683f (diff)
downloadsubsurface-d0e9f626245e7833847ad25ae3b97c5ab87caccb.tar.gz
mobile: add qmlprefs class
add class to cmake and pro register class Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/main.qml4
-rw-r--r--mobile-widgets/qmlprefs.cpp21
-rw-r--r--mobile-widgets/qmlprefs.h25
3 files changed, 50 insertions, 0 deletions
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index bd567894e..28f16a9b8 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -492,6 +492,10 @@ if you have network connectivity and want to sync your data to cloud storage."),
}
}
+ QMLPrefs {
+ id: prefs
+ }
+
QMLManager {
id: manager
}
diff --git a/mobile-widgets/qmlprefs.cpp b/mobile-widgets/qmlprefs.cpp
new file mode 100644
index 000000000..49a788708
--- /dev/null
+++ b/mobile-widgets/qmlprefs.cpp
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "qmlprefs.h"
+
+QMLPrefs *QMLPrefs::m_instance = NULL;
+
+
+QMLPrefs::QMLPrefs()
+{
+ if (!m_instance)
+ m_instance = this;
+}
+
+QMLPrefs::~QMLPrefs()
+{
+ m_instance = NULL;
+}
+
+QMLPrefs *QMLPrefs::instance()
+{
+ return m_instance;
+}
diff --git a/mobile-widgets/qmlprefs.h b/mobile-widgets/qmlprefs.h
new file mode 100644
index 000000000..2755014e8
--- /dev/null
+++ b/mobile-widgets/qmlprefs.h
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef QMLPREFS_H
+#define QMLPREFS_H
+
+#include <QObject>
+
+
+class QMLPrefs : public QObject {
+ Q_OBJECT
+
+public:
+ QMLPrefs();
+ ~QMLPrefs();
+
+ static QMLPrefs *instance();
+
+public slots:
+
+private:
+ static QMLPrefs *m_instance;
+
+signals:
+};
+
+#endif