make text-based filter work for feed list
This commit is contained in:
parent
81be271c27
commit
e68317fdcd
1 changed files with 8 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue