Verified Commit c2a59896 authored by Ingo Klöcker's avatar Ingo Klöcker Committed by Ingo Klöcker
Browse files

Do not crash when closing details widget while certificate dump is shown

Closing the details widget triggers the destruction of its children. The
destruction of the DumpCertificateDialog triggers the finished signal
of the DumpCertificateCommand, but at this point ui.moreDetailsBtn has
already been destroyed.
The easiest solution is not to disable the moreDetailsBtn temporarily
since this allows us to remove the problematic connect. The "downside"
is that not disabling the button enables the user to open multiple
Certificate Dump dialogs, but that's not really a problem.

GnuPG-bug-id: 6180
parent 3e8472b5
Pipeline #229508 passed with stage
in 4 minutes and 6 seconds
......@@ -865,21 +865,15 @@ void CertificateDetailsWidget::Private::userIDTableContextMenuRequested(const QP
void CertificateDetailsWidget::Private::showMoreDetails()
{
ui.moreDetailsBtn->setEnabled(false);
if (key.protocol() == GpgME::CMS) {
auto cmd = new Kleo::Commands::DumpCertificateCommand(key);
cmd->setParentWidget(q);
connect(cmd, &Kleo::Commands::DumpCertificateCommand::finished,
q, [this]() {
ui.moreDetailsBtn->setEnabled(true);
});
cmd->setUseDialog(true);
cmd->start();
} else {
QScopedPointer<SubKeysDialog> dlg(new SubKeysDialog(q));
dlg->setKey(key);
dlg->exec();
ui.moreDetailsBtn->setEnabled(true);
}
}
......
Supports Markdown
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