diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-14 14:18:51 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-14 14:18:51 -0700 |
commit | 0c44bc7271eaeff541bbf0b30c3afe372165b2be (patch) | |
tree | 397f8653f349d11bea22c84618394bfdcdb0b192 /qt-ui/subsurfacewebservices.cpp | |
parent | 4b120d1bf54f339eaea488c71faecb5395defaf3 (diff) | |
download | subsurface-0c44bc7271eaeff541bbf0b30c3afe372165b2be.tar.gz |
Cloud storage: clear our last error if verification succeeds
This is cosmetic but makes things friendlier, I think.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 1deb3099c..dfaf69468 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -974,14 +974,21 @@ QNetworkReply* CloudStorageAuthenticate::authenticate(QString email, QString pas void CloudStorageAuthenticate::uploadFinished() { + static QString myLastError; + QString cloudAuthReply(reply->readAll()); qDebug() << "Completed connection with cloud storage backend, response" << cloudAuthReply; if (cloudAuthReply == "[VERIFIED]" || cloudAuthReply == "[OK]") { prefs.cloud_verification_status = CS_VERIFIED; + NotificationWidget *nw = MainWindow::instance()->getNotificationWidget(); + if (nw->getNotificationText() == myLastError) + nw->hideNotification(); + myLastError.clear(); } else if (cloudAuthReply == "[VERIFY]") { prefs.cloud_verification_status = CS_NEED_TO_VERIFY; } else { prefs.cloud_verification_status = CS_INCORRECT_USER_PASSWD; + myLastError = cloudAuthReply; report_error("%s", qPrintable(cloudAuthReply)); MainWindow::instance()->getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error); } |