Commit fb35bf85 authored by Ingo Klöcker's avatar Ingo Klöcker Committed by Ingo Klöcker
Browse files

Prevent recursion if post processing triggers another key listing

Disconnect the key list connection when it has been triggered.

GnuPG-bug-id: 5715
parent 721e9825
Pipeline #104931 passed with stage
in 3 minutes and 17 seconds
......@@ -600,13 +600,15 @@ void ImportCertificatesCommand::Private::tryToFinish()
}
auto keyCache = KeyCache::mutableInstance();
connect(keyCache.get(), &KeyCache::keyListingDone,
q, [this]() { keyCacheUpdated(); });
keyListConnection = connect(keyCache.get(), &KeyCache::keyListingDone,
q, [this]() { keyCacheUpdated(); });
keyCache->startKeyListing();
}
void ImportCertificatesCommand::Private::keyCacheUpdated()
{
disconnect(keyListConnection);
keyCacheAutoRefreshSuspension.reset();
if (std::any_of(std::cbegin(results), std::cend(results), &importFailed)) {
......
......@@ -125,6 +125,7 @@ private:
std::vector<ImportResultData> results;
std::vector<ImportedGroup> importedGroups;
std::shared_ptr<KeyCacheAutoRefreshSuspension> keyCacheAutoRefreshSuspension;
QMetaObject::Connection keyListConnection;
};
inline Kleo::ImportCertificatesCommand::Private *Kleo::ImportCertificatesCommand::d_func()
......
Markdown is supported
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