summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <aheinecke@intevation.de>2016-08-04 15:41:05 (GMT)
committerAndre Heinecke <aheinecke@intevation.de>2016-08-04 15:41:05 (GMT)
commitbdc575a44d9aa49bf226a05f9c890f6e9f3c365d (patch)
tree92f42e94e8316d9372dd9cdff86e373abe6a4b70
parentbafe34e3c5aee70bc2f250435e65125d6e36fa0d (diff)
Fix filtering for multiple uids again
If we return false on the first not matching UID this will of course have the effect that only the primary uid is considered again.
-rw-r--r--src/models/keylistsortfilterproxymodel.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/models/keylistsortfilterproxymodel.cpp b/src/models/keylistsortfilterproxymodel.cpp
index 37d4076..4aab2fa 100644
--- a/src/models/keylistsortfilterproxymodel.cpp
+++ b/src/models/keylistsortfilterproxymodel.cpp
@@ -194,13 +194,18 @@ bool KeyListSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelI
}
} else {
// By default match name and email of any UID
+ bool match = false;
Q_FOREACH(const auto uid, key.userIDs()) {
const auto name = QString::fromUtf8(uid.name());
const auto email = QString::fromUtf8(uid.email());
- if (!name.contains(rx) && !email.contains(rx)) {
- return false;
+ if (name.contains(rx) || email.contains(rx)) {
+ match = true;
+ break;
}
}
+ if (!match) {
+ return false;
+ }
}
//