From d6114fc37e922c51341ea71cbcc58543d12f7a49 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 23 Feb 2020 20:18:13 +0100 Subject: mobile/filter: derive numShown from a new Q_PROPERTY The number of dives was updated when the model of the list was changed. Since we removed the multi-threading, the model is not disconnected/connected anymore and therefore we don't get the appropriate signal. Instead of introducing a different signal, make the shown-value a Q_PROPERTY. Thus, we can easily send a changed signal if we have to. Signed-off-by: Berthold Stoeger --- mobile-widgets/qml/DiveList.qml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index aa58b232c..7bf79671c 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -17,7 +17,6 @@ Kirigami.ScrollablePage { property color secondaryTextColor: subsurfaceTheme.secondaryTextColor property int horizontalPadding: Kirigami.Units.gridUnit / 2 - Kirigami.Units.smallSpacing + 1 property QtObject diveListModel: diveTripModel - property string numShownText opacity: 0 Behavior on opacity { @@ -481,7 +480,7 @@ Kirigami.ScrollablePage { id: numShown z: 10 verticalAlignment: Text.AlignVCenter - text: numShownText + text: diveModel.shown } } } @@ -503,9 +502,6 @@ Kirigami.ScrollablePage { section.criteria: ViewSection.FullString section.delegate: tripHeading section.labelPositioning: ViewSection.CurrentLabelAtStart | ViewSection.InlineLabels - onModelChanged: { - numShownText = diveModel.shown() - } Connections { target: detailsWindow onCurrentIndexChanged: diveListView.currentIndex = detailsWindow.currentIndex @@ -555,7 +551,6 @@ Kirigami.ScrollablePage { onTriggered: { rootItem.filterToggle = !rootItem.filterToggle manager.setFilter("", 0) - numShownText = diveModel.shown() } } -- cgit v1.2.3-70-g09d2