aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-03 06:32:12 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-03 06:32:12 -0800
commitc5153fbc10d23ab2e83879f4d262b682233dc97d (patch)
tree7dc62561e6c6f8a9bbd591fcaac65ff2ceda86df /qt-mobile/qmlmanager.cpp
parent055316e4a9b3fdf84bfe67b734561d6c7edfd097 (diff)
downloadsubsurface-c5153fbc10d23ab2e83879f4d262b682233dc97d.tar.gz
QML UI: ensure that cloud notification is always cleared
All error cases need to reset it as well. And it's easier to reset it right after we come back from parse_file() instead of trying to track all the exit cases after that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r--qt-mobile/qmlmanager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index 085f3d5f8..00f3829aa 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -237,6 +237,7 @@ void QMLManager::handleSslErrors(const QList<QSslError> &errors)
}
reply->abort();
reply->deleteLater();
+ setAccessingCloud(false);
}
void QMLManager::handleError(QNetworkReply::NetworkError nError)
@@ -246,6 +247,7 @@ void QMLManager::handleError(QNetworkReply::NetworkError nError)
setStartPageText(tr("Cannot open cloud storage: %1").arg(errorString));
reply->abort();
reply->deleteLater();
+ setAccessingCloud(false);
}
void QMLManager::retrieveUserid()
@@ -260,6 +262,7 @@ void QMLManager::retrieveUserid()
if (userid.isEmpty()) {
if (same_string(prefs.cloud_storage_email, "") || same_string(prefs.cloud_storage_password, "")) {
appendTextToLog("cloud user name or password are empty, can't retrieve web user id");
+ setAccessingCloud(false);
return;
}
appendTextToLog(QStringLiteral("calling getUserid with user %1").arg(prefs.cloud_storage_email));
@@ -318,6 +321,7 @@ void QMLManager::loadDivesWithValidCredentials()
DiveListModel::instance()->clear();
int error = parse_file(fileNamePrt.data());
+ setAccessingCloud(false);
if (!error) {
report_error("filename is now %s", fileNamePrt.data());
const char *error_string = get_error_string();
@@ -328,7 +332,6 @@ void QMLManager::loadDivesWithValidCredentials()
QString errorString(get_error_string());
appendTextToLog(errorString);
setStartPageText(tr("Cloud storage error: %1").arg(errorString));
- setAccessingCloud(false);
return;
}
prefs.unit_system = informational_prefs.unit_system;
@@ -347,7 +350,6 @@ void QMLManager::loadDivesWithValidCredentials()
if (dive_table.nr == 0)
setStartPageText(tr("Cloud storage open successfully. No dives in dive list."));
setLoadFromCloud(true);
- setAccessingCloud(false);
}
void QMLManager::refreshDiveList()