diff options
Diffstat (limited to 'lang/qt/src')
-rw-r--r-- | lang/qt/src/protocol.h | 14 | ||||
-rw-r--r-- | lang/qt/src/protocol_p.h | 12 |
2 files changed, 26 insertions, 0 deletions
diff --git a/lang/qt/src/protocol.h b/lang/qt/src/protocol.h index 5162fe6a..e5153b50 100644 --- a/lang/qt/src/protocol.h +++ b/lang/qt/src/protocol.h @@ -96,6 +96,20 @@ public: virtual ChangeOwnerTrustJob *changeOwnerTrustJob() const = 0; virtual AddUserIDJob *addUserIDJob() const = 0; virtual SpecialJob *specialJob(const char *type, const QMap<QString, QVariant> &args) const = 0; + + /** A key locate job. + * + * This tries to find a key in local + * and remote sources, if the key was remote it is imported + * by GnuPG. Same as KeyListJob but intended to be used + * to locate keys automatically. This ends up calling --locate-keys. + * + * Only available for OpenPGP + * + * Results are validated. As if keyListJob was called + * with both includeSigs and validate options. + */ + virtual KeyListJob *locateKeysJob() const = 0; }; /** Obtain a reference to the OpenPGP Protocol. diff --git a/lang/qt/src/protocol_p.h b/lang/qt/src/protocol_p.h index d6c5625a..9fcbc8b7 100644 --- a/lang/qt/src/protocol_p.h +++ b/lang/qt/src/protocol_p.h @@ -365,6 +365,18 @@ public: return new QGpgME::QGpgMEAddUserIDJob(context); } + QGpgME::KeyListJob *locateKeysJob() const Q_DECL_OVERRIDE + { + if (mProtocol != GpgME::OpenPGP) { + return Q_NULLPTR; + } + GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); + if (!context) { + return Q_NULLPTR; + } + context->setKeyListMode(GpgME::Extern | GpgME::Local | GpgME::Signatures | GpgME::Validate); + return new QGpgME::QGpgMEKeyListJob(context); + } }; } |