Commit 2006ff93 authored by Felix Tiede's avatar Felix Tiede Committed by Ingo Klöcker
Browse files

Use member variable for wksJob.

See !16 (comment 428719)

With this change, cancelling a publish request job will also delete the
corresponding WKS job.
parent 95fd2793
......@@ -94,7 +94,7 @@ void ExportOpenPGPCertToProviderCommand::doStart()
KStandardGuiItem::cont(), KStandardGuiItem::cancel(),
QStringLiteral("warn-export-openpgp-wks-unsupported"))
== KMessageBox::Continue) {
auto wksJob = QGpgME::openpgp()->wksPublishJob();
wksJob = QGpgME::openpgp()->wksPublishJob();
connect(wksJob, &QGpgME::WKSPublishJob::result, this, &ExportOpenPGPCertToProviderCommand::wksJobResult);
wksJob->startCreate(d->key().primaryFingerprint(), senderAddress());
} else {
......@@ -104,6 +104,9 @@ void ExportOpenPGPCertToProviderCommand::doStart()
void ExportOpenPGPCertToProviderCommand::doCancel()
{
if (wksJob) {
delete wksJob;
}
d->canceled();
}
......
......@@ -12,8 +12,15 @@
#include <commands/command.h>
#include <QPointer>
#include <gpgme++/key.h>
namespace QGpgME
{
class WKSPublishJob;
}
namespace Kleo
{
namespace Commands
......@@ -43,6 +50,8 @@ private:
QString senderAddress() const;
GpgME::UserID uid;
QPointer<QGpgME::WKSPublishJob> wksJob;
};
}
......
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