Commit 4d9dfcc1 authored by David Rosca's avatar David Rosca

Fix crash when closing new account dialog with close button

Connect QDialogButtonBox rejected signal to QDialog reject slot.

REVIEW: 123545
parent 6f930d38
......@@ -182,7 +182,8 @@ void KAccountsUiProvider::onConnectionManagerReady(Tp::PendingOperation*)
QDialogButtonBox *dbb = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, d->dialog);
connect(dbb, &QDialogButtonBox::accepted, this, &KAccountsUiProvider::onCreateAccountDialogAccepted);
connect(dbb, &QDialogButtonBox::rejected, this, &KAccountsUiProvider::onCreateAccountDialogRejected);
connect(dbb, &QDialogButtonBox::rejected, d->dialog, &QDialog::reject);
connect(d->dialog, &QDialog::rejected, this, &KAccountsUiProvider::onCreateAccountDialogRejected);
mainLayout->addWidget(d->accountEditWidget);
mainLayout->addWidget(dbb);
......@@ -234,7 +235,8 @@ void KAccountsUiProvider::showConfigureAccountDialog(const quint32 accountId)
QDialogButtonBox *dbb = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, d->dialog);
connect(dbb, &QDialogButtonBox::accepted, this, &KAccountsUiProvider::onConfigureAccountDialogAccepted);
connect(dbb, &QDialogButtonBox::rejected, this, &KAccountsUiProvider::onConfigureAccountDialogRejected);
connect(dbb, &QDialogButtonBox::rejected, d->dialog, &QDialog::reject);
connect(d->dialog, &QDialog::rejected, this, &KAccountsUiProvider::onConfigureAccountDialogRejected);
if (passwordParameter.isValid()) {
QModelIndex index = parameterModel->indexForParameter(passwordParameter);
......@@ -312,7 +314,6 @@ void KAccountsUiProvider::onCreateAccountDialogAccepted()
void KAccountsUiProvider::onCreateAccountDialogRejected()
{
d->dialog->reject();
Q_EMIT error(QString());
}
......@@ -427,7 +428,6 @@ void KAccountsUiProvider::onConfigureAccountFinished()
void KAccountsUiProvider::onConfigureAccountDialogRejected()
{
d->dialog->reject();
Q_EMIT error(QString());
}
......
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