Skip to content
Snippets Groups Projects
Commit 5bb5ce0f authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

smartlist: filter banned items when the filter string is empty

Gitlab: #418
Change-Id: I1c1a8004b8d268cb3be158a7766c5ae82d451e63
parent a3d28714
No related branches found
No related tags found
Loading
......@@ -107,12 +107,15 @@ ConversationListProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& s
auto registeredName = index.data(ConversationList::Role::RegisteredName).toString();
auto itemProfileType = index.data(ConversationList::Role::ContactType).toInt();
auto typeFilter = static_cast<profile::Type>(itemProfileType) == currentTypeFilter_;
bool match {false};
if (index.data(ConversationList::Role::IsBanned).toBool()) {
return typeFilter
&& (rx.exactMatch(uri) || rx.exactMatch(alias) || rx.exactMatch(registeredName));
match = !rx.isEmpty()
&& (rx.exactMatch(uri) || rx.exactMatch(alias) || rx.exactMatch(registeredName));
} else {
match = (rx.indexIn(uri) != -1 || rx.indexIn(alias) != -1
|| rx.indexIn(registeredName) != -1);
}
return typeFilter
&& (rx.indexIn(uri) != -1 || rx.indexIn(alias) != -1 || rx.indexIn(registeredName) != -1);
return typeFilter && match;
}
bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment