aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/src/protocol_p.h
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2021-12-13 09:48:52 +0000
committerIngo Klöcker <[email protected]>2021-12-13 09:48:52 +0000
commited7e7df2e14feb443e84d87e518ff61b1f7aa6d8 (patch)
treefc292441ad64e0c4313c13a16ce98be8b9b4119f /lang/qt/src/protocol_p.h
parentqt: Fix example for using the asynchronous job API (diff)
downloadgpgme-ed7e7df2e14feb443e84d87e518ff61b1f7aa6d8.tar.gz
gpgme-ed7e7df2e14feb443e84d87e518ff61b1f7aa6d8.zip
qt: Support WKD lookup without implicit import
* lang/qt/src/Makefile.am (qgpgme_sources): Add qgpgmewkdlookupjob.cpp, wkdlookupresult.cpp. (qgpgme_headers): Add wkdlookupjob.h, wkdlookupresult.h. (camelcase_headers): Add WKDLookupJob, WKDLookupResult. (private_qgpgme_headers): Add qgpgmewkdlookupjob.h. (qgpgme_moc_sources): Add qgpgmewkdlookupjob.moc, wkdlookupjob.moc. * lang/qt/src/job.cpp: Define c'tor and d'tor of WKDLookupJob. * lang/qt/src/protocol.h (Protocol::wkdLookupJob): New. * lang/qt/src/protocol_p.h (Protocol::wkdLookupJob): New. * lang/qt/src/qgpgmewkdlookupjob.cpp, lang/qt/src/qgpgmewkdlookupjob.h, lang/qt/src/wkdlookupjob.h, lang/qt/src/wkdlookupresult.cpp, lang/qt/src/wkdlookupresult.h: New. * lang/qt/tests/Makefile.am (EXTRA_DIST): Add final.test. (the_tests): New. (TESTS): Remove all t-*. Add $(the_tests) and final.test. (moc_files): Add t-wkdlookup.moc. (t_wkdlookup_SOURCES): New. (noinst_PROGRAMS): Add t-wkdlookup. * lang/qt/tests/final.test: New. * lang/qt/tests/t-support.h (QTest::toString): New template specialization for std::string. * lang/qt/tests/t-wkdlookup.cpp: New. -- The new WKDLookupJob allows running a WKD lookup without implicit import of the retrieved key. This makes it possible to do WKD lookups similar to keyserver lookups (aka external keylistings). The new final.test pseudo test stops a dirmngr that may have been started by the tests. The toString() template specialization enables printing of the actual and expected values in case of failed QCOMPARE. GnuPG-bug-id: 5728
Diffstat (limited to 'lang/qt/src/protocol_p.h')
-rw-r--r--lang/qt/src/protocol_p.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/lang/qt/src/protocol_p.h b/lang/qt/src/protocol_p.h
index 57c1ed81..da5ce011 100644
--- a/lang/qt/src/protocol_p.h
+++ b/lang/qt/src/protocol_p.h
@@ -58,6 +58,7 @@
#include "qgpgmechangepasswdjob.h"
#include "qgpgmeadduseridjob.h"
#include "qgpgmekeyformailboxjob.h"
+#include "qgpgmewkdlookupjob.h"
#include "qgpgmewkspublishjob.h"
#include "qgpgmetofupolicyjob.h"
#include "qgpgmequickjob.h"
@@ -392,6 +393,18 @@ public:
return new QGpgME::QGpgMEKeyForMailboxJob(context);
}
+ QGpgME::WKDLookupJob *wkdLookupJob() const Q_DECL_OVERRIDE
+ {
+ if (mProtocol != GpgME::OpenPGP) {
+ return nullptr;
+ }
+ auto context = GpgME::Context::createForEngine(GpgME::AssuanEngine);
+ if (!context) {
+ return nullptr;
+ }
+ return new QGpgME::QGpgMEWKDLookupJob(context.release());
+ }
+
QGpgME::WKSPublishJob *wksPublishJob() const Q_DECL_OVERRIDE
{
if (mProtocol != GpgME::OpenPGP) {