diff options
author | saturneric <[email protected]> | 2024-07-28 15:32:25 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-07-28 15:32:25 +0000 |
commit | 28546a83da7eb4ace931fe2f26124fe935d4b0c5 (patch) | |
tree | 7cccd2618395959eb732cd2a012d529b95a01684 | |
parent | feat: double-click key table row wil show detail dialog (diff) | |
download | GpgFrontend-28546a83da7eb4ace931fe2f26124fe935d4b0c5.tar.gz GpgFrontend-28546a83da7eb4ace931fe2f26124fe935d4b0c5.zip |
feat: search for keywords in all uids
-rw-r--r-- | src/core/model/GpgKeyTableProxyModel.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/model/GpgKeyTableProxyModel.cpp b/src/core/model/GpgKeyTableProxyModel.cpp index 5ed9ade3..aa5cc4b1 100644 --- a/src/core/model/GpgKeyTableProxyModel.cpp +++ b/src/core/model/GpgKeyTableProxyModel.cpp @@ -83,12 +83,17 @@ auto GpgKeyTableProxyModel::filterAcceptsRow( for (int column = 0; column < sourceModel()->columnCount(); ++column) { auto index = sourceModel()->index(source_row, column, sourceParent); infos << sourceModel()->data(index).toString(); - } - for (const QString &info : infos) { - if (info.contains(filter_keywords_, Qt::CaseInsensitive)) return true; + const auto uids = key.GetUIDs(); + for (const auto &uid : *uids) { + infos << uid.GetUID(); + } } + return std::any_of(infos.cbegin(), infos.cend(), [&](const QString &info) { + return info.contains(filter_keywords_, Qt::CaseInsensitive); + }); + return false; } |