Mobile: modify filter so that all models get notified
When we change the filter string, we need to make sure that the collapsed model is also aware of the change. Similarly, instead of just calling resetFilter and directly changing the core data structures, we need to set the filter to the empty string which ensures that all three models get notified and the view updates correctly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
20fda8afc3
commit
15674f1a71
@ -557,7 +557,7 @@ Kirigami.ScrollablePage {
|
||||
text: qsTr("Filter dives")
|
||||
onTriggered: {
|
||||
rootItem.filterToggle = !rootItem.filterToggle
|
||||
diveModel.resetFilter()
|
||||
manager.setFilter("")
|
||||
numShownText = diveModel.shown()
|
||||
}
|
||||
}
|
||||
|
||||
@ -2090,6 +2090,7 @@ void QMLManager::setFilter(const QString filterText)
|
||||
QtConcurrent::run(QThreadPool::globalInstance(),
|
||||
[=]{
|
||||
DiveListSortModel::instance()->setFilter(filterText);
|
||||
CollapsedDiveListSortModel::instance()->updateFilterState();
|
||||
QMetaObject::invokeMethod(qmlWindow, "hideBusyAndConnectModel");
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user