From c5153fbc10d23ab2e83879f4d262b682233dc97d Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 3 Mar 2016 06:32:12 -0800 Subject: 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 --- qt-mobile/qmlmanager.cpp | 6 ++++-- 1 file 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 &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() -- cgit v1.2.3-70-g09d2