aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-09-12 08:55:55 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-12 20:16:46 -0700
commitc454f6954f0fc5fdd490c50ff13f556660de5ed8 (patch)
treec02f22bf63e17dd8c5200ac7d7e2acfc3b550026
parentf8e9fb72f12990ce5c89de94eeb4effa2757d38b (diff)
downloadsubsurface-c454f6954f0fc5fdd490c50ff13f556660de5ed8.tar.gz
mobile-widgets: make show_developer persistent
Remove developer from qmlprefs and use qPref instead Update qml show_developer is saved on disk, and thus remembered between starts. Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--mobile-widgets/qml/Settings.qml4
-rw-r--r--mobile-widgets/qml/main.qml2
-rw-r--r--mobile-widgets/qmlprefs.cpp7
-rw-r--r--mobile-widgets/qmlprefs.h8
4 files changed, 3 insertions, 18 deletions
diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml
index 4ba414adf..484a69a67 100644
--- a/mobile-widgets/qml/Settings.qml
+++ b/mobile-widgets/qml/Settings.qml
@@ -363,10 +363,10 @@ Kirigami.ScrollablePage {
}
SsrfSwitch {
id: developerButton
- checked: prefs.developer
+ checked: PrefDisplay.show_developer
Layout.preferredWidth: gridWidth * 0.25
onClicked: {
- prefs.developer = checked
+ PrefDisplay.show_developer = checked
}
}
}
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index 1120750e8..bdd3335e3 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -361,7 +361,7 @@ if you have network connectivity and want to sync your data to cloud storage."),
name: ":/icons/ic_adb.svg"
}
text: qsTr("Developer")
- visible: prefs.developer
+ visible: PrefDisplay.show_developer
Kirigami.Action {
text: qsTr("App log")
onTriggered: {
diff --git a/mobile-widgets/qmlprefs.cpp b/mobile-widgets/qmlprefs.cpp
index 99bde2426..4e8cc8726 100644
--- a/mobile-widgets/qmlprefs.cpp
+++ b/mobile-widgets/qmlprefs.cpp
@@ -11,7 +11,6 @@ QMLPrefs *QMLPrefs::m_instance = NULL;
QMLPrefs::QMLPrefs() :
m_credentialStatus(qPrefCloudStorage::CS_UNKNOWN),
- m_developer(false),
m_distanceThreshold(1000),
m_oldStatus(qPrefCloudStorage::CS_UNKNOWN),
m_showPin(false),
@@ -87,12 +86,6 @@ void QMLPrefs::setCredentialStatus(const qPrefCloudStorage::cloud_status value)
}
}
-void QMLPrefs::setDeveloper(bool value)
-{
- m_developer = value;
- emit developerChanged();
-}
-
int QMLPrefs::distanceThreshold() const
{
return m_distanceThreshold;
diff --git a/mobile-widgets/qmlprefs.h b/mobile-widgets/qmlprefs.h
index ed38c0530..f1cd41fb4 100644
--- a/mobile-widgets/qmlprefs.h
+++ b/mobile-widgets/qmlprefs.h
@@ -25,10 +25,6 @@ class QMLPrefs : public QObject {
MEMBER m_credentialStatus
WRITE setCredentialStatus
NOTIFY credentialStatusChanged)
- Q_PROPERTY(bool developer
- MEMBER m_developer
- WRITE setDeveloper
- NOTIFY developerChanged)
Q_PROPERTY(int distanceThreshold
MEMBER m_distanceThreshold
WRITE setDistanceThreshold
@@ -68,8 +64,6 @@ public:
qPrefCloudStorage::cloud_status credentialStatus() const;
void setCredentialStatus(const qPrefCloudStorage::cloud_status value);
- void setDeveloper(bool value);
-
int distanceThreshold() const;
void setDistanceThreshold(int distance);
@@ -94,7 +88,6 @@ private:
QString m_cloudPin;
QString m_cloudUserName;
qPrefCloudStorage::cloud_status m_credentialStatus;
- bool m_developer;
int m_distanceThreshold;
static QMLPrefs *m_instance;
qPrefCloudStorage::cloud_status m_oldStatus;
@@ -107,7 +100,6 @@ signals:
void cloudUserNameChanged();
void credentialStatusChanged();
void distanceThresholdChanged();
- void developerChanged();
void oldStatusChanged();
void showPinChanged();
void themeChanged();