Merge pull request #961 from flowln/fix_resource_filter

This commit is contained in:
Sefa Eyeoglu 2022-07-26 20:14:18 +02:00 committed by GitHub
commit 86573a5ccd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,13 +32,13 @@ class SortProxy : public QSortFilterProxyModel {
const auto& mod = model->at(source_row); const auto& mod = model->at(source_row);
if (mod.name().contains(filterRegularExpression())) if (filterRegularExpression().match(mod.name()).hasMatch())
return true; return true;
if (mod.description().contains(filterRegularExpression())) if (filterRegularExpression().match(mod.description()).hasMatch())
return true; return true;
for (auto& author : mod.authors()) { for (auto& author : mod.authors()) {
if (author.contains(filterRegularExpression())) { if (filterRegularExpression().match(author).hasMatch()) {
return true; return true;
} }
} }
@ -182,7 +182,7 @@ void ExternalResourcesPage::retranslate()
void ExternalResourcesPage::filterTextChanged(const QString& newContents) void ExternalResourcesPage::filterTextChanged(const QString& newContents)
{ {
m_viewFilter = newContents; m_viewFilter = newContents;
m_filterModel->setFilterFixedString(m_viewFilter); m_filterModel->setFilterRegularExpression(m_viewFilter);
} }
void ExternalResourcesPage::runningStateChanged(bool running) void ExternalResourcesPage::runningStateChanged(bool running)