mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make password change asynchronous
This isn't perfect (if you make multiple requests things could go badly), but it's better than just slapping the new password into the settings, even if the update failed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
aa9c2b7384
commit
9a68e356af
5 changed files with 17 additions and 2 deletions
|
@ -423,10 +423,11 @@ void PreferencesDialog::syncSettings()
|
|||
} else {
|
||||
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
||||
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
|
||||
connect(cloudAuth, SIGNAL(passwordChangeSuccessful()), this, SLOT(passwordUpdateSuccessfull()));
|
||||
QNetworkReply *reply = cloudAuth->backend(email, password, "", newpassword);
|
||||
ui.cloud_storage_new_passwd->setText("");
|
||||
ui.cloud_storage_password->setText(newpassword);
|
||||
password = newpassword;
|
||||
free(prefs.cloud_storage_newpassword);
|
||||
prefs.cloud_storage_newpassword = strdup(qPrintable(newpassword));
|
||||
}
|
||||
}
|
||||
} else if (prefs.cloud_verification_status == CS_UNKNOWN ||
|
||||
|
@ -688,6 +689,11 @@ void PreferencesDialog::on_resetSettings_clicked()
|
|||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::passwordUpdateSuccessfull()
|
||||
{
|
||||
ui.cloud_storage_password->setText(prefs.cloud_storage_password);
|
||||
}
|
||||
|
||||
void PreferencesDialog::emitSettingsChanged()
|
||||
{
|
||||
emit settingsChanged();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue