aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-07 22:59:26 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-10 10:30:50 -0700
commit4a4bc1c8f39e39aacba0a58a41a6fa8cbc63e4b0 (patch)
tree33bc10ed011a017a34f968edb428e8a60905ed5d /core
parent06593bd6425dcb9db016774e5238497b9a3d48bd (diff)
downloadsubsurface-4a4bc1c8f39e39aacba0a58a41a6fa8cbc63e4b0.tar.gz
core: add version variables to qPref and make it qml loadable
add canonical_version and mobile_version to qPref Having a property in qPref, allows the use in qml, and prepare the interface for qml testing. Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core')
-rw-r--r--core/settings/qPref.cpp11
-rw-r--r--core/settings/qPref.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/core/settings/qPref.cpp b/core/settings/qPref.cpp
index 791ec44b8..189fad499 100644
--- a/core/settings/qPref.cpp
+++ b/core/settings/qPref.cpp
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include "qPref_private.h"
#include "qPref.h"
+#include "ssrf-version.h"
qPref::qPref(QObject *parent) :
QObject(parent)
@@ -15,3 +16,13 @@ static qPref *self = new qPref;
void qPref::loadSync(bool doSync)
{
}
+
+const QString qPref::canonical_version() const
+{
+ return QString(CANONICAL_VERSION_STRING);
+}
+
+const QString qPref::mobile_version() const
+{
+ return QString(MOBILE_VERSION_STRING);
+}
diff --git a/core/settings/qPref.h b/core/settings/qPref.h
index 44dc6e075..e0e21ad6e 100644
--- a/core/settings/qPref.h
+++ b/core/settings/qPref.h
@@ -11,6 +11,8 @@
class qPref : public QObject {
Q_OBJECT
Q_ENUMS(cloud_status);
+ Q_PROPERTY(QString canonical_version READ canonical_version);
+ Q_PROPERTY(QString mobile_version READ mobile_version);
public:
qPref(QObject *parent = NULL);
@@ -28,6 +30,8 @@ public:
CS_NOCLOUD
};
+ const QString canonical_version() const;
+ const QString mobile_version() const;
private:
};