diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-04-06 11:42:38 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-04-06 11:42:38 -0700 |
commit | 6a23e0ef664d081ec9351603c76af8c46edd4e89 (patch) | |
tree | 63f7729315127b563c542b33599d64023d01737b /mobile-widgets/qmlmanager.cpp | |
parent | f21b36d9ba15bb36b4b3cda49498cbf95606c2ae (diff) | |
download | subsurface-6a23e0ef664d081ec9351603c76af8c46edd4e89.tar.gz |
QML UI: save with unchanged credentials returns to dive list
If the user is on the credentials page, doesn't change the credentials
but simply taps on save, they now get back to the dive list.
Fixes #1047
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index d030f5a72..3d478178d 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -213,6 +213,10 @@ void QMLManager::saveCloudCredentials() cloudCredentialsChanged |= !same_string(prefs.cloud_storage_password, qPrintable(cloudPassword())); + if (!cloudCredentialsChanged) { + // just go back to the dive list + setCredentialStatus(oldStatus()); + } if (!same_string(prefs.cloud_storage_password, qPrintable(cloudPassword()))) { free(prefs.cloud_storage_password); prefs.cloud_storage_password = strdup(qPrintable(cloudPassword())); @@ -1014,6 +1018,19 @@ void QMLManager::setCredentialStatus(const credentialStatus_t value) } } +QMLManager::credentialStatus_t QMLManager::oldStatus() const +{ + return m_oldStatus; +} + +void QMLManager::setOldStatus(const credentialStatus_t value) +{ + if (m_oldStatus != value) { + m_oldStatus = value; + emit oldStatusChanged(); + } +} + // where in the QML dive list is that dive? int QMLManager::getIndex(const QString &diveId) { |