diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-16 14:15:31 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-18 09:44:08 +0100 |
commit | e592dfe17c5a1a6d2b714752f5b27e9d531de9bb (patch) | |
tree | c082e8c0022a8934c6ef41d9853078c7c70d9427 /desktop-widgets/preferences/preferences_network.cpp | |
parent | d28f48a793aef1e1c07a28758c97f399f8c0a93b (diff) | |
download | subsurface-e592dfe17c5a1a6d2b714752f5b27e9d531de9bb.tar.gz |
Whitespace only
Now that we properly return when raising an error, do not
if () else if(). Useles.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'desktop-widgets/preferences/preferences_network.cpp')
-rw-r--r-- | desktop-widgets/preferences/preferences_network.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/desktop-widgets/preferences/preferences_network.cpp b/desktop-widgets/preferences/preferences_network.cpp index 252694037..3552fa9db 100644 --- a/desktop-widgets/preferences/preferences_network.cpp +++ b/desktop-widgets/preferences/preferences_network.cpp @@ -71,18 +71,18 @@ void PreferencesNetwork::syncSettings() if (!reg.match(email).hasMatch() || (!password.isEmpty() && !reg.match(password).hasMatch())) { report_error(qPrintable(tr("Change ignored. Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'."))); return; - } else if (!reg.match(email).hasMatch() || (!newpassword.isEmpty() && !reg.match(newpassword).hasMatch())) { + } + if (!reg.match(email).hasMatch() || (!newpassword.isEmpty() && !reg.match(newpassword).hasMatch())) { report_error(qPrintable(tr("Change ignored. Cloud storage email and new password can only consist of letters, numbers, and '.', '-', '_', and '+'."))); ui->cloud_storage_new_passwd->setText(""); return; - } else { - CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this); - connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesNetwork::updateCloudAuthenticationState); - connect(cloudAuth, &CloudStorageAuthenticate::passwordChangeSuccessful, this, &PreferencesNetwork::passwordUpdateSuccessful); - cloudAuth->backend(email, password, "", newpassword); - ui->cloud_storage_new_passwd->setText(""); - cloud->setNewPassword(newpassword); } + CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this); + connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesNetwork::updateCloudAuthenticationState); + connect(cloudAuth, &CloudStorageAuthenticate::passwordChangeSuccessful, this, &PreferencesNetwork::passwordUpdateSuccessful); + cloudAuth->backend(email, password, "", newpassword); + ui->cloud_storage_new_passwd->setText(""); + cloud->setNewPassword(newpassword); } } else if (prefs.cloud_verification_status == CS_UNKNOWN || prefs.cloud_verification_status == CS_INCORRECT_USER_PASSWD || @@ -99,11 +99,10 @@ void PreferencesNetwork::syncSettings() report_error(qPrintable(tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'."))); cloud->setVerificationStatus(oldVerificationStatus); return; - } else { - CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this); - connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesNetwork::updateCloudAuthenticationState); - cloudAuth->backend(email, password); } + CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this); + connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesNetwork::updateCloudAuthenticationState); + cloudAuth->backend(email, password); } } else if (prefs.cloud_verification_status == CS_NEED_TO_VERIFY) { QString pin = ui->cloud_storage_pin->text(); |