From 3f297387bf401475385c458e4d1d95b3eefaf3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Wed, 23 Aug 2023 12:00:26 +0200 Subject: qt: Allow specifying user IDs to use when refreshing keys via WKD * lang/qt/src/wkdrefreshjob.h, lang/qt/src/wkdrefreshjob.cpp (WKDRefreshJob::start): New overload. * lang/qt/src/wkdrefreshjob_p.h (WKDRefreshJobPrivate): Add field m_userIds. * lang/qt/src/qgpgmewkdrefreshjob.cpp (toEmailAddresses): New. (locate_external_keys): Change return type and arguments. (refresh_keys): Remove. (QGpgMEWKDRefreshJobPrivate::startIt): Get emails from keys or user IDs. Remove duplicates. Call locate_external_keys instead of refresh_keys. * lang/qt/tests/run-wkdrefreshjob.cpp (CommandLineOptions, parseCommandLine): New. (main): Support new option --all-userids. -- The new start() overload allows to specify the user IDs to use for the WKD lookup explicitly. This allows updating user IDs via WKD which were originally not retrieved via WKD. GnuPG-bug-id: 6672 --- lang/qt/src/wkdrefreshjob.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lang/qt/src/wkdrefreshjob.cpp') diff --git a/lang/qt/src/wkdrefreshjob.cpp b/lang/qt/src/wkdrefreshjob.cpp index 37b990c8..f79df2c5 100644 --- a/lang/qt/src/wkdrefreshjob.cpp +++ b/lang/qt/src/wkdrefreshjob.cpp @@ -54,4 +54,11 @@ GpgME::Error WKDRefreshJob::start(const std::vector &keys) return d->startIt(); } +GpgME::Error WKDRefreshJob::start(const std::vector &userIDs) +{ + auto d = jobPrivate(this); + d->m_userIds = userIDs; + return d->startIt(); +} + #include "wkdrefreshjob.moc" -- cgit v1.2.3