Filter: use changed-signals to update filter

The dive-trip models now send changed-events if the shown-status
changed. Thus, there is no reason to fully reset the filter on
filter changes.

Simply tell the filter that it has to react to changes of SHOWN_ROLE.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-11-24 11:17:06 +01:00 committed by bstoeger
parent 7d5c15f49a
commit d0b3a06e03

View file

@ -15,8 +15,8 @@ MultiFilterSortModel *MultiFilterSortModel::instance()
MultiFilterSortModel::MultiFilterSortModel(QObject *parent) : QSortFilterProxyModel(parent)
{
connect(&diveListNotifier, &DiveListNotifier::filterReset, this, &MultiFilterSortModel::invalidateFilter);
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);
}