mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed missing filterAcceptsRow() in forum proxy model
This commit is contained in:
parent
d5928ca84e
commit
d7b5c9766c
@ -285,6 +285,14 @@ public:
|
|||||||
return left.data(RsGxsForumModel::SortRole) < right.data(RsGxsForumModel::SortRole) ;
|
return left.data(RsGxsForumModel::SortRole) < right.data(RsGxsForumModel::SortRole) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
|
||||||
|
{
|
||||||
|
//std::cerr << "FilterAcceptsRow(): source_row=" << source_row << " parent=" << (void*)source_parent.internalPointer() << " role=\"" <<
|
||||||
|
// sourceModel()->index(source_row,0,source_parent).data(RsGxsForumModel::FilterRole).toString().toStdString() << std::endl;
|
||||||
|
|
||||||
|
return sourceModel()->index(source_row,0,source_parent).data(RsGxsForumModel::FilterRole).toString() == RsGxsForumModel::FilterString ;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QHeaderView *m_header ;
|
const QHeaderView *m_header ;
|
||||||
};
|
};
|
||||||
@ -1684,6 +1692,9 @@ void GxsForumThreadWidget::filterItems(const QString& text)
|
|||||||
uint32_t count;
|
uint32_t count;
|
||||||
mThreadModel->setFilter(filterColumn,lst,count) ;
|
mThreadModel->setFilter(filterColumn,lst,count) ;
|
||||||
|
|
||||||
|
// We do this in order to trigger a new filtering action in the proxy model.
|
||||||
|
mThreadProxyModel->setFilterRegExp(QRegExp(QString(RsGxsForumModel::FilterString))) ;
|
||||||
|
|
||||||
if(!lst.empty())
|
if(!lst.empty())
|
||||||
ui->threadTreeWidget->expandAll();
|
ui->threadTreeWidget->expandAll();
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user