mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive list: remove filtering in MultiFilterSortModel
Since we're doing the filtering at the core, don't filter in the sort-model (which is now inappropriately named). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
7633d5feec
commit
77a1c7c1f4
1 changed files with 1 additions and 6 deletions
|
@ -16,9 +16,6 @@ MultiFilterSortModel *MultiFilterSortModel::instance()
|
||||||
MultiFilterSortModel::MultiFilterSortModel(QObject *parent) : QSortFilterProxyModel(parent)
|
MultiFilterSortModel::MultiFilterSortModel(QObject *parent) : QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
resetModel(DiveTripModelBase::TREE);
|
resetModel(DiveTripModelBase::TREE);
|
||||||
setFilterKeyColumn(-1); // filter all columns
|
|
||||||
setFilterRole(DiveTripModelBase::SHOWN_ROLE); // Let the proxy-model known that is has to react to change events involving SHOWN_ROLE
|
|
||||||
setFilterCaseSensitivity(Qt::CaseInsensitive);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiFilterSortModel::resetModel(DiveTripModelBase::Layout layout)
|
void MultiFilterSortModel::resetModel(DiveTripModelBase::Layout layout)
|
||||||
|
@ -62,9 +59,7 @@ void MultiFilterSortModel::currentDiveChangedSlot(QModelIndex index)
|
||||||
|
|
||||||
bool MultiFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
|
bool MultiFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
|
||||||
{
|
{
|
||||||
QAbstractItemModel *m = sourceModel();
|
return true;
|
||||||
QModelIndex index0 = m->index(source_row, 0, source_parent);
|
|
||||||
return m->data(index0, DiveTripModelBase::SHOWN_ROLE).value<bool>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MultiFilterSortModel::lessThan(const QModelIndex &i1, const QModelIndex &i2) const
|
bool MultiFilterSortModel::lessThan(const QModelIndex &i1, const QModelIndex &i2) const
|
||||||
|
|
Loading…
Add table
Reference in a new issue