Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 65aecd5d authored by Krzysztof Nowicki's avatar Krzysztof Nowicki

EWS: Allow password prompt to be interrupted

This should finally fix the isolated test, which displays the prompt and
just stops there, as there is nobody to answer it.
parent 7de3fa1f
......@@ -92,15 +92,15 @@ void EwsSettings::requestPassword(bool ask)
qCDebug(EWSRES_LOG) << "requestPassword: Not allowed to ask";
} else {
qCDebug(EWSRES_LOG) << "requestPassword: Requesting interactively";
QPointer<KPasswordDialog> dlg = new KPasswordDialog(nullptr);
dlg->setModal(true);
dlg->setPrompt(i18n("Please enter password for user '%1' and Exchange account '%2'.",
mPasswordDlg = new KPasswordDialog(nullptr);
mPasswordDlg->setModal(true);
mPasswordDlg->setPrompt(i18n("Please enter password for user '%1' and Exchange account '%2'.",
username(), email()));
if (dlg->exec() == QDialog::Accepted) {
mPassword = dlg->password();
if (mPasswordDlg->exec() == QDialog::Accepted) {
mPassword = mPasswordDlg->password();
setPassword(mPassword);
}
delete dlg;
delete mPasswordDlg;
}
}
......@@ -152,6 +152,9 @@ void EwsSettings::setPassword(const QString &password)
if (mWallet) {
onWalletOpenedForRead(true);
}
if (mPasswordDlg) {
mPasswordDlg->reject();
}
mWallet = Wallet::openWallet(Wallet::NetworkWallet(),
mWindowId, Wallet::Asynchronous);
......@@ -187,5 +190,8 @@ void EwsSettings::setTestPassword(const QString &password)
if (mWallet) {
onWalletOpenedForRead(true);
}
if (mPasswordDlg) {
mPasswordDlg->reject();
}
}
......@@ -32,6 +32,7 @@
namespace KWallet {
class Wallet;
}
class KPasswordDialog;
class EwsSettings : public EwsSettingsBase
{
......@@ -57,6 +58,7 @@ private:
QPointer<KWallet::Wallet> mWallet;
QTimer mWalletReadTimer;
QTimer mWalletWriteTimer;
QPointer<KPasswordDialog> mPasswordDlg;
};
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment