From c64a8daf507a2216611861a12f312466b0bae8b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Wed, 4 May 2022 14:51:50 +0200 Subject: qt: Emit import result when refreshing OpenPGP keys * lang/qt/src/refreshopenpgpkeysjob.h: New. * lang/qt/src/Makefile.am, lang/qt/src/job.cpp: Update accordingly. * lang/qt/src/qgpgmerefreshopenpgpkeysjob.h (class QGpgMERefreshOpenPGPKeysJob): Derive from RefreshOpenPGPKeysJob with result ImportResult. Remove unused start overload. * lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp (locate_external_keys): Ignore result of KeyListJob. Return import result. (receive_keys): Return import result. (refresh_keys): Merge the two import results and return the result. * lang/qt/src/protocol.h (class Protocol): Add pure virtual member function refreshOpenPGPKeysJob. * lang/qt/src/protocol_p.h (Protocol::refreshKeysJob): Return nullptr for OpenPGP protocol. (Protocol::refreshOpenPGPKeysJob): New. * lang/qt/tests/run-refreshkeysjob.cpp (main): Use appropriate job for the protocol of the key to refresh. -- This adds RefreshOpenPGPKeysJob complementing RefreshKeysJob (for S/MIME keys). Changing the result type of RefreshKeysJob would break the ABI. Therefore we have to introduce a new base class for the refresh job for OpenPGP. We derive this base class from AbstractImportJob because we want to return an import result. GnuPG-bug-id: 5951 --- lang/qt/src/job.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lang/qt/src/job.cpp') diff --git a/lang/qt/src/job.cpp b/lang/qt/src/job.cpp index dba7556b..4a379f12 100644 --- a/lang/qt/src/job.cpp +++ b/lang/qt/src/job.cpp @@ -61,6 +61,7 @@ #include "downloadjob.h" #include "deletejob.h" #include "refreshkeysjob.h" +#include "refreshopenpgpkeysjob.h" #include "addexistingsubkeyjob.h" #include "adduseridjob.h" #include "specialjob.h" @@ -157,6 +158,7 @@ make_job_subclass(AbstractImportJob) make_job_subclass_ext(ImportJob, AbstractImportJob) make_job_subclass_ext(ImportFromKeyserverJob, AbstractImportJob) make_job_subclass_ext(ReceiveKeysJob, AbstractImportJob) +make_job_subclass_ext(RefreshOpenPGPKeysJob, AbstractImportJob) make_job_subclass(ExportJob) make_job_subclass(ChangeExpiryJob) make_job_subclass(ChangeOwnerTrustJob) @@ -200,6 +202,7 @@ make_job_subclass(RevokeKeyJob) #include "downloadjob.moc" #include "deletejob.moc" #include "refreshkeysjob.moc" +#include "refreshopenpgpkeysjob.moc" #include "addexistingsubkeyjob.moc" #include "adduseridjob.moc" #include "specialjob.moc" -- cgit v1.2.3