UI: Programs: Fix "Filters" menu with "Search" text applying

This commit is contained in:
Nodir Temirkhodjaev 2024-05-20 19:50:14 +03:00
parent a094b1214a
commit 272a4e74a7

View File

@ -568,14 +568,14 @@ QString AppListModel::sqlWhere() const
QString sql = FtsTableSqlModel::sqlWhere();
if (filters() != FilterNone) {
if (sql.isEmpty()) {
sql = " WHERE ";
}
QStringList list;
if (filters().testFlag(FilterWildcard)) {
sql += QString("t.is_wildcard = %1")
list << QString("t.is_wildcard = %1")
.arg(filterValues().testFlag(FilterWildcard) ? "1" : "0");
}
sql += (sql.isEmpty() ? " WHERE " : " AND ") + list.join(" AND ");
}
return sql;