aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-03 14:30:30 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-03 14:30:30 -0800
commita0b83dc2f16fa3042966aeedc85e7eacfc4a200c (patch)
treec532500c0eef4757a5d24dfee49986fcdafcbad7
parent7a94360a6da6665ea42de29c39246a5ebc67dada (diff)
downloadsubsurface-a0b83dc2f16fa3042966aeedc85e7eacfc4a200c.tar.gz
QML UI: different functions for saving Preferences and Cloud Credentials
Tapping Save on those two pages should only update the data that are actually available on those pages. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-mobile/qml/CloudCredentials.qml2
-rw-r--r--qt-mobile/qmlmanager.cpp8
-rw-r--r--qt-mobile/qmlmanager.h1
3 files changed, 8 insertions, 3 deletions
diff --git a/qt-mobile/qml/CloudCredentials.qml b/qt-mobile/qml/CloudCredentials.qml
index 20bc82f66..bada5c04d 100644
--- a/qt-mobile/qml/CloudCredentials.qml
+++ b/qt-mobile/qml/CloudCredentials.qml
@@ -72,7 +72,7 @@ Item {
manager.cloudUserName = login.text
manager.cloudPassword = password.text
manager.saveCloudPassword = savePassword.checked
- manager.savePreferences()
+ manager.saveCloudCredentials()
stackView.pop()
}
}
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index d5a3c51ad..64e8a6714 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -42,13 +42,17 @@ QMLManager::~QMLManager()
void QMLManager::savePreferences()
{
QSettings s;
- bool cloudCredentialsChanged = false;
s.beginGroup("LocationService");
s.setValue("time_threshold", timeThreshold() * 60);
prefs.time_threshold = timeThreshold() * 60;
s.setValue("distance_threshold", distanceThreshold());
prefs.distance_threshold = distanceThreshold();
- s.endGroup();
+}
+
+void QMLManager::saveCloudCredentials()
+{
+ QSettings s;
+ bool cloudCredentialsChanged = false;
s.beginGroup("CloudStorage");
s.setValue("email", cloudUserName());
s.setValue("save_password_local", saveCloudPassword());
diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h
index c76fce975..f91417519 100644
--- a/qt-mobile/qmlmanager.h
+++ b/qt-mobile/qmlmanager.h
@@ -50,6 +50,7 @@ public:
public slots:
void savePreferences();
+ void saveCloudCredentials();
void loadDives();
void commitChanges(QString diveId, QString suit, QString buddy, QString diveMaster, QString notes);
void saveChanges();