mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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
2 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue