aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-14 16:52:25 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-21 07:49:25 -0700
commitb9b1f03f0d77f1eea86efeed8776a623bd5b30ee (patch)
tree1804b5204b538d082673ed0223768de2f602bb95 /desktop-widgets
parent4b68329c9db7ed13eaed7dd36ce6c82b1d7d11ca (diff)
downloadsubsurface-b9b1f03f0d77f1eea86efeed8776a623bd5b30ee.tar.gz
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 <jani@apache.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/preferences/preferences_network.cpp22
-rw-r--r--desktop-widgets/subsurfacewebservices.cpp4
2 files changed, 13 insertions, 13 deletions
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 <errno.h>
#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) {