From cf3fcc53b61b1545cf18beff267f7157f9dcd10f Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 20 Oct 2018 12:04:00 -0400 Subject: 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 --- mobile-widgets/qml/DiveList.qml | 7 +++++-- mobile-widgets/qml/main.qml | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index f158aaff1..639979a97 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -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 diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index bf0830f46..d2988f115 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -64,10 +64,12 @@ Kirigami.ApplicationWindow { function showBusy() { busy.running = true + diveList.diveListModel = null } function hideBusy() { busy.running = false + diveList.diveListModel = diveModel } function returnTopPage() { -- cgit v1.2.3-70-g09d2