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

Don't show result widget or error message if operation was canceled

GnuPG-bug-id: 6196
parent 3ebfde6d
Pipeline #229585 passed with stage
in 4 minutes
......@@ -282,13 +282,15 @@ public:
mProgressBar->setVisible(false);
mProgressLabel->setVisible(false);
mLastResultWidget = new ResultItemWidget(result);
mLastResultWidget->showCloseButton(true);
mStatusLay->addWidget(mLastResultWidget);
if (!result->error().isCanceled()) {
mLastResultWidget = new ResultItemWidget(result);
mLastResultWidget->showCloseButton(true);
mStatusLay->addWidget(mLastResultWidget);
connect(mLastResultWidget, &ResultItemWidget::closeButtonClicked, q, [this] () {
removeLastResultItem();
});
connect(mLastResultWidget, &ResultItemWidget::closeButtonClicked, q, [this] () {
removeLastResultItem();
});
}
// Check result protocol
if (mPGPRB) {
......@@ -305,21 +307,21 @@ public:
config.writeEntry("wasCMS", proto == GpgME::CMS);
}
if (result->error().code()) {
if (result->error()) {
if (!result->errorString().isEmpty()) {
KMessageBox::error(q,
result->errorString(),
i18nc("@title", "Error in crypto action"));
}
return;
}
mEdit->setPlainText(QString::fromUtf8(mOutputData));
mOutputData.clear();
mRevertBtn->setVisible(true);
const auto decryptVerifyResult = dynamic_cast<const Kleo::Crypto::DecryptVerifyResult*>(result.get());
if (decryptVerifyResult) {
updateRecipientsFromResult(*decryptVerifyResult);
} else if (!result->error().isCanceled()) {
mEdit->setPlainText(QString::fromUtf8(mOutputData));
mOutputData.clear();
mRevertBtn->setVisible(true);
const auto decryptVerifyResult = dynamic_cast<const Kleo::Crypto::DecryptVerifyResult*>(result.get());
if (decryptVerifyResult) {
updateRecipientsFromResult(*decryptVerifyResult);
}
}
}
......
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