Mobile/filtering: implement the filter update through a thread

It's important to disconnect the model from the ListView, otherwise the update in a
different thread will fail.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-10-20 12:04:00 -04:00
parent 84822ebd2f
commit cf3fcc53b6
2 changed files with 7 additions and 2 deletions

View file

@ -411,8 +411,7 @@ Kirigami.ScrollablePage {
text: ""
placeholderText: "Full text search"
onAccepted: {
rootItem.filterPattern = text
diveModel.setFilter(text)
manager.setFilter(text)
console.log("back from setFilter")
}
onEnabledChanged: {
@ -451,6 +450,10 @@ Kirigami.ScrollablePage {
section.criteria: ViewSection.FullString
section.delegate: tripHeading
section.labelPositioning: ViewSection.CurrentLabelAtStart | ViewSection.InlineLabels
onModelChanged: {
numShownText = diveModel.shown()
console.log("update number shown to " + numShownText)
}
Connections {
target: detailsWindow
onCurrentIndexChanged: diveListView.currentIndex = detailsWindow.currentIndex

View file

@ -64,10 +64,12 @@ Kirigami.ApplicationWindow {
function showBusy() {
busy.running = true
diveList.diveListModel = null
}
function hideBusy() {
busy.running = false
diveList.diveListModel = diveModel
}
function returnTopPage() {