From a0b83dc2f16fa3042966aeedc85e7eacfc4a200c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 3 Dec 2015 14:30:30 -0800 Subject: 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 --- qt-mobile/qml/CloudCredentials.qml | 2 +- qt-mobile/qmlmanager.cpp | 8 ++++++-- qt-mobile/qmlmanager.h | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'qt-mobile') 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(); -- cgit v1.2.3-70-g09d2