summaryrefslogtreecommitdiffstats
path: root/qt-ui/subsurfacewebservices.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-14 14:18:51 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-14 14:18:51 -0700
commit0c44bc7271eaeff541bbf0b30c3afe372165b2be (patch)
tree397f8653f349d11bea22c84618394bfdcdb0b192 /qt-ui/subsurfacewebservices.cpp
parent4b120d1bf54f339eaea488c71faecb5395defaf3 (diff)
downloadsubsurface-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.cpp7
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);
}