From e68317fdcdd9293c77e2e75c00cf153a6adc2d4a Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 26 May 2025 07:27:39 +0200 Subject: [PATCH] make text-based filter work for feed list --- src/librssguard/core/feedsproxymodel.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/librssguard/core/feedsproxymodel.cpp b/src/librssguard/core/feedsproxymodel.cpp index 239f46048..146594735 100644 --- a/src/librssguard/core/feedsproxymodel.cpp +++ b/src/librssguard/core/feedsproxymodel.cpp @@ -471,6 +471,8 @@ bool FeedsProxyModel::filterAcceptsRowInternal(int source_row, const QModelIndex return true; } + bool should_show = QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); + if (item->kind() == RootItem::Kind::Feed) { const Feed* feed = item->toFeed(); @@ -480,17 +482,18 @@ bool FeedsProxyModel::filterAcceptsRowInternal(int source_row, const QModelIndex if (m_filters[val](feed)) { // The item matches the feed filter. // Display it if it matches internal string-based filter too. - return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); + return should_show; } } } - // The item does not match feed filter. - // Display it only if it is selected. - return m_filter == FeedListFilter::NoFiltering; + if (m_filter != FeedListFilter::NoFiltering) { + // Some filter is enabled but this item does not meet it. + return false; + } } - return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); + return should_show; } bool FeedsProxyModel::sortAlphabetically() const {