diff options
author | saturneric <[email protected]> | 2024-01-25 17:24:23 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-25 17:24:23 +0000 |
commit | f604b865cc119717e3dbe4296f20f9b3db0a1c87 (patch) | |
tree | 59992c5fd165e40206d964f490e6874cd6c73c8c | |
parent | feat: enhance analysed results of verification and signing (diff) | |
download | GpgFrontend-f604b865cc119717e3dbe4296f20f9b3db0a1c87.tar.gz GpgFrontend-f604b865cc119717e3dbe4296f20f9b3db0a1c87.zip |
feat: enhance keys searching functions
-rw-r--r-- | src/core/GpgCoreInit.cpp | 12 | ||||
-rw-r--r-- | src/ui/widgets/KeyList.cpp | 14 |
2 files changed, 20 insertions, 6 deletions
diff --git a/src/core/GpgCoreInit.cpp b/src/core/GpgCoreInit.cpp index 04531faf..38b8f33a 100644 --- a/src/core/GpgCoreInit.cpp +++ b/src/core/GpgCoreInit.cpp @@ -438,7 +438,17 @@ void InitGpgFrontendCore(CoreInitArgs args) { "received callback from gnupg-info-gathering "); // try to restart all components - GpgFrontend::GpgAdvancedOperator::RestartGpgComponents(); + auto settings = + GlobalSettingStation::GetInstance().GetSettings(); + auto restart_all_gnupg_components_on_start = + settings + .value("gnupg/restart_all_gnupg_components_on_start", + false) + .toBool(); + + if (restart_all_gnupg_components_on_start) { + GpgAdvancedOperator::RestartGpgComponents(); + } Module::UpsertRTValue("core", "env.state.gnupg", 1); // announce that all checkings were finished diff --git a/src/ui/widgets/KeyList.cpp b/src/ui/widgets/KeyList.cpp index a9c8e38f..48c99269 100644 --- a/src/ui/widgets/KeyList.cpp +++ b/src/ui/widgets/KeyList.cpp @@ -579,12 +579,16 @@ void KeyTable::Refresh(KeyLinkListPtr m_keys) { while (it != keys->end()) { // filter by search bar's keyword if (ability_ & KeyMenuAbility::SEARCH_BAR && !keyword_.isEmpty()) { - auto name = it->GetName().toLower(); - auto email = it->GetEmail().toLower(); - auto comment = it->GetComment().toLower(); + QStringList infos; + infos << it->GetName().toLower() << it->GetEmail().toLower() + << it->GetComment().toLower() << it->GetFingerprint().toLower(); - if (!name.contains(keyword_) && !email.contains(keyword_) && - !comment.contains(keyword_)) { + auto subkeys = it->GetSubKeys(); + for (const auto& subkey : *subkeys) { + infos << subkey.GetFingerprint().toLower() << subkey.GetID().toLower(); + } + + if (infos.filter(keyword_.toLower()).isEmpty()) { it = keys->erase(it); continue; } |