From b9b1f03f0d77f1eea86efeed8776a623bd5b30ee Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sat, 14 Jul 2018 16:52:25 +0200 Subject: core: activate qPrefCloudStorage remove CloudStorage from SettingsObjectWrapper and reference qPrefCloudStorage update files using SettingsObjectWrapper/CloudStorage to use qPrefCloudStorage this activated qPrefCloudStorage and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen --- .../preferences/preferences_network.cpp | 22 +++++++++++----------- desktop-widgets/subsurfacewebservices.cpp | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/preferences/preferences_network.cpp b/desktop-widgets/preferences/preferences_network.cpp index 37dbc5721..ba08cea63 100644 --- a/desktop-widgets/preferences/preferences_network.cpp +++ b/desktop-widgets/preferences/preferences_network.cpp @@ -48,8 +48,8 @@ void PreferencesNetwork::syncSettings() auto cloud = SettingsObjectWrapper::instance()->cloud_storage; auto proxy = SettingsObjectWrapper::instance()->proxy; - cloud->setUserId(ui->default_uid->text().toUpper()); - cloud->setSaveUserIdLocal(ui->save_uid_local->checkState()); + cloud->set_userid(ui->default_uid->text().toUpper()); + cloud->set_save_userid_local(ui->save_uid_local->checkState()); proxy->setType(ui->proxyType->itemData(ui->proxyType->currentIndex()).toInt()); proxy->setHost(ui->proxyHost->text()); @@ -82,7 +82,7 @@ void PreferencesNetwork::syncSettings() connect(cloudAuth, &CloudStorageAuthenticate::passwordChangeSuccessful, this, &PreferencesNetwork::passwordUpdateSuccessful); cloudAuth->backend(email, password, "", newpassword); ui->cloud_storage_new_passwd->setText(""); - cloud->setNewPassword(newpassword); + cloud->set_cloud_storage_newpassword(newpassword); } } else if (prefs.cloud_verification_status == qPref::CS_UNKNOWN || prefs.cloud_verification_status == qPref::CS_INCORRECT_USER_PASSWD || @@ -90,14 +90,14 @@ void PreferencesNetwork::syncSettings() password != prefs.cloud_storage_password) { // different credentials - reset verification status - int oldVerificationStatus = cloud->verificationStatus(); - cloud->setVerificationStatus(qPref::CS_UNKNOWN); + int oldVerificationStatus = cloud->cloud_verification_status(); + cloud->set_cloud_verification_status(qPref::CS_UNKNOWN); if (!email.isEmpty() && !password.isEmpty()) { // connect to backend server to check / create credentials QRegularExpression reg("^[a-zA-Z0-9@.+_-]+$"); if (!reg.match(email).hasMatch() || (!password.isEmpty() && !reg.match(password).hasMatch())) { report_error(qPrintable(tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'."))); - cloud->setVerificationStatus(oldVerificationStatus); + cloud->set_cloud_verification_status(oldVerificationStatus); return; } CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this); @@ -118,11 +118,11 @@ void PreferencesNetwork::syncSettings() cloudAuth->backend(email, password, pin); } } - cloud->setEmail(email); - cloud->setSavePasswordLocal(ui->save_password_local->isChecked()); - cloud->setPassword(password); - cloud->setVerificationStatus(prefs.cloud_verification_status); - cloud->setBaseUrl(prefs.cloud_base_url); + cloud->set_cloud_storage_email(email); + cloud->set_save_password_local(ui->save_password_local->isChecked()); + cloud->set_cloud_storage_password(password); + cloud->set_cloud_verification_status(prefs.cloud_verification_status); + cloud->set_cloud_base_url(prefs.cloud_base_url); } void PreferencesNetwork::updateCloudAuthenticationState() diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp index 5ed068d2f..d1af7715d 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -2,6 +2,7 @@ #include "desktop-widgets/subsurfacewebservices.h" #include "core/qthelper.h" #include "core/webservice.h" +#include "core/settings/qPref.h" #include "desktop-widgets/mainwindow.h" #include "desktop-widgets/usersurvey.h" #include "core/divelist.h" @@ -9,7 +10,6 @@ #include "desktop-widgets/tab-widgets/maintab.h" #include "core/display.h" #include "core/membuffer.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" #include #include "core/cloudstorage.h" #include "core/subsurface-string.h" @@ -436,7 +436,7 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button) QSettings s; QString qDialogUid = ui.userID->text().toUpper(); bool qSaveUid = ui.saveUidLocal->checkState(); - SettingsObjectWrapper::instance()->cloud_storage->setSaveUserIdLocal(qSaveUid); + qPrefCloudStorage::instance()->set_save_userid_local(qSaveUid); //WARN: Dirk, this seems to be wrong, I coundn't really understand the code. if (qSaveUid) { -- cgit v1.2.3-70-g09d2