diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-09-10 11:26:09 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-09-11 21:50:41 +0100 |
commit | b1ba687a1d9f98faff974fdced119cd545d40c1b (patch) | |
tree | 78d9d6299b097bddf0eb3794931cba7714280d56 /mobile-widgets | |
parent | f6f6a2055579808430a2f843b003397242bdecbd (diff) | |
download | subsurface-b1ba687a1d9f98faff974fdced119cd545d40c1b.tar.gz |
Mobile: deal better with incorrect credentials
This could happen if the password was changed from a different Subsurface instance.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index ea0f52c6c..8dcacf4cc 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -291,8 +291,9 @@ void QMLManager::openLocalThenRemote(QString url) * care about this, as the very first commit of dive data to the * no cloud repo solves this. */ - - if (QMLPrefs::instance()->credentialStatus() != qPrefCloudStorage::CS_NOCLOUD) + auto credStatus = QMLPrefs::instance()->credentialStatus(); + if (credStatus != qPrefCloudStorage::CS_NOCLOUD && + credStatus != qPrefCloudStorage::CS_INCORRECT_USER_PASSWD) QMLPrefs::instance()->setCredentialStatus(qPrefCloudStorage::CS_NEED_TO_VERIFY); } else { // if we can load from the cache, we know that we have a valid cloud account @@ -317,6 +318,10 @@ void QMLManager::openLocalThenRemote(QString url) appendTextToLog(QStringLiteral("have cloud credentials, but still needs PIN")); QMLPrefs::instance()->setShowPin(true); } + if (QMLPrefs::instance()->credentialStatus() == qPrefCloudStorage::CS_INCORRECT_USER_PASSWD) { + appendTextToLog(QStringLiteral("incorrect password for cloud credentials")); + setNotificationText(tr("Incorrect cloud credentials")); + } if (QMLPrefs::instance()->oldStatus() == qPrefCloudStorage::CS_NOCLOUD) { // if we switch to credentials from CS_NOCLOUD, we take things online temporarily git_local_only = false; |