From 1b9581369af95bdf366f08c0d00d24c315d339bb Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 14 Aug 2019 23:53:28 +0200 Subject: Mobile: move tripId from DiveObjectHelper to DiveListModel The canonical way of displaying lists in Qt is via models. Thus, return the tripId directly from the DiveListModel instead of going indirectly via a DiveObjectHelper. In the future, this will allow us to make the DiveObjectHelper value-based, as it is not generated numerous times for every list item. Signed-off-by: Berthold Stoeger --- mobile-widgets/qml/DiveList.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mobile-widgets/qml/DiveList.qml') diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 23537ac79..6be6d6d8f 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -57,7 +57,7 @@ Kirigami.ScrollablePage { states: [ State { name: "isHidden"; - when: dive.tripId !== activeTrip && ! diveOutsideTrip + when: tripId !== activeTrip && ! diveOutsideTrip PropertyChanges { target: innerListItem height: 0 @@ -66,7 +66,7 @@ Kirigami.ScrollablePage { }, State { name: "isVisible"; - when: dive.tripId === activeTrip || diveOutsideTrip + when: tripId === activeTrip || diveOutsideTrip PropertyChanges { target: innerListItem height: diveListEntry.height + Kirigami.Units.smallSpacing @@ -129,7 +129,7 @@ Kirigami.ScrollablePage { Item { Rectangle { id: leftBarDive - width: dive.tripId == "" ? 0 : Kirigami.Units.smallSpacing + width: tripId == "" ? 0 : Kirigami.Units.smallSpacing height: diveListEntry.height * 0.8 color: subsurfaceTheme.lightPrimaryColor anchors { @@ -524,7 +524,7 @@ Kirigami.ScrollablePage { maximumFlickVelocity: parent.height * 5 bottomMargin: Kirigami.Units.iconSizes.medium + Kirigami.Units.gridUnit cacheBuffer: 40 // this will increase memory use, but should help with scrolling - section.property: "dive.tripId" + section.property: "tripId" section.criteria: ViewSection.FullString section.delegate: tripHeading section.labelPositioning: ViewSection.CurrentLabelAtStart | ViewSection.InlineLabels -- cgit v1.2.3-70-g09d2