diff options
author | jan Iversen <jan@casacondor.com> | 2019-11-23 17:34:13 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-05 11:48:26 -0800 |
commit | d0dcc7b32a9f8f332cb9ae268cfa7e0797ad19ec (patch) | |
tree | 6102c693e620e64b59623bb2aaaa7607f0f947e3 | |
parent | a4ea0f62af41c72975f41bc06f6e2eaf6851ac77 (diff) | |
download | subsurface-d0dcc7b32a9f8f332cb9ae268cfa7e0797ad19ec.tar.gz |
core: correct cloudstorage.cpp to use static qPrefCloudStorage functions.
qPrefCloudStorage set/get functions are static.
remove creation of qPrefCloudStorage instance, reference
static functions.
Signed-off-by: Jan Iversen <jan@casacondor.com>
-rw-r--r-- | core/cloudstorage.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/cloudstorage.cpp b/core/cloudstorage.cpp index c3108bc2b..d949a8989 100644 --- a/core/cloudstorage.cpp +++ b/core/cloudstorage.cpp @@ -50,10 +50,9 @@ void CloudStorageAuthenticate::uploadFinished() QString cloudAuthReply(reply->readAll()); qDebug() << "Completed connection with cloud storage backend, response" << cloudAuthReply; - qPrefCloudStorage csSettings(parent()); if (cloudAuthReply == QLatin1String("[VERIFIED]") || cloudAuthReply == QLatin1String("[OK]")) { - csSettings.set_cloud_verification_status(qPrefCloudStorage::CS_VERIFIED); + qPrefCloudStorage::set_cloud_verification_status(qPrefCloudStorage::CS_VERIFIED); /* TODO: Move this to a correct place NotificationWidget *nw = MainWindow::instance()->getNotificationWidget(); if (nw->getNotificationText() == myLastError) @@ -62,15 +61,15 @@ void CloudStorageAuthenticate::uploadFinished() myLastError.clear(); } else if (cloudAuthReply == QLatin1String("[VERIFY]") || cloudAuthReply == QLatin1String("Invalid PIN")) { - csSettings.set_cloud_verification_status(qPrefCloudStorage::CS_NEED_TO_VERIFY); + qPrefCloudStorage::set_cloud_verification_status(qPrefCloudStorage::CS_NEED_TO_VERIFY); report_error(qPrintable(tr("Cloud account verification required, enter PIN in preferences"))); } else if (cloudAuthReply == QLatin1String("[PASSWDCHANGED]")) { - csSettings.set_cloud_storage_password(cloudNewPassword); + qPrefCloudStorage::set_cloud_storage_password(cloudNewPassword); cloudNewPassword.clear(); emit passwordChangeSuccessful(); return; } else { - csSettings.set_cloud_verification_status(qPrefCloudStorage::CS_INCORRECT_USER_PASSWD); + qPrefCloudStorage::set_cloud_verification_status(qPrefCloudStorage::CS_INCORRECT_USER_PASSWD); myLastError = cloudAuthReply; report_error("%s", qPrintable(cloudAuthReply)); } |