Commit 87d8b00d authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Use ReceiveKeysJob for refreshing OpenPGP keys

This refreshes the OpenPGP key from the configured key server.

GnuPG-bug-id: 5903
parent 45d1f6b3
Pipeline #212719 passed with stage
in 3 minutes and 57 seconds
......@@ -19,7 +19,7 @@
#include <QGpgME/Protocol>
#ifdef QGPGME_SUPPORTS_KEY_REFRESH
#include <QGpgME/RefreshKeysJob>
#include <QGpgME/RefreshOpenPGPKeysJob>
#include <QGpgME/ReceiveKeysJob>
#endif
#include <gpgme++/importresult.h>
......@@ -44,7 +44,7 @@ public:
void cancel();
#ifdef QGPGME_SUPPORTS_KEY_REFRESH
std::unique_ptr<QGpgME::RefreshOpenPGPKeysJob> startOpenPGPJob();
std::unique_ptr<QGpgME::ReceiveKeysJob> startOpenPGPJob();
std::unique_ptr<QGpgME::RefreshKeysJob> startSMIMEJob();
#endif
void onOpenPGPJobResult(const ImportResult &result);
......@@ -136,19 +136,19 @@ void RefreshCertificateCommand::Private::cancel()
}
#ifdef QGPGME_SUPPORTS_KEY_REFRESH
std::unique_ptr<QGpgME::RefreshOpenPGPKeysJob> RefreshCertificateCommand::Private::startOpenPGPJob()
std::unique_ptr<QGpgME::ReceiveKeysJob> RefreshCertificateCommand::Private::startOpenPGPJob()
{
std::unique_ptr<QGpgME::RefreshOpenPGPKeysJob> refreshJob{QGpgME::openpgp()->refreshOpenPGPKeysJob()};
std::unique_ptr<QGpgME::ReceiveKeysJob> refreshJob{QGpgME::openpgp()->receiveKeysJob()};
Q_ASSERT(refreshJob);
connect(refreshJob.get(), &QGpgME::RefreshOpenPGPKeysJob::result,
connect(refreshJob.get(), &QGpgME::ReceiveKeysJob::result,
q, [this](const GpgME::ImportResult &result) {
onOpenPGPJobResult(result);
});
connect(refreshJob.get(), &QGpgME::Job::progress,
q, &Command::progress);
const GpgME::Error err = refreshJob->start({key});
const GpgME::Error err = refreshJob->start({QString::fromLatin1(key.primaryFingerprint())});
if (err) {
showError(err);
return {};
......
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