From 9322c54b6a1e1bb85954b106be5410e413a05c14 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 14 Sep 2019 19:58:30 +0200 Subject: Mobile: pass section directly to tripTitle() and tripShortDate() Instead of converting the section-heading string to a trip-pointer in QML and pass that to the tripTitle() and tripShortDate() functions, pass the string and convert in C++ code. Hopefully, this makes the code more robust. Signed-off-by: Berthold Stoeger --- mobile-widgets/qml/DiveList.qml | 6 ++---- 1 file changed, 2 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 a2cb1e40c..b2c99a02b 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -353,8 +353,7 @@ Kirigami.ScrollablePage { } Controls.Label { text: { - var trip = diveListView.model.tripIdToObject(section); - diveListView.model.tripShortDate(trip); + diveListView.model.tripShortDate(section) } color: subsurfaceTheme.primaryTextColor font.pointSize: subsurfaceTheme.smallPointSize @@ -379,8 +378,7 @@ Kirigami.ScrollablePage { Controls.Label { id: sectionText text: { - var trip = diveListView.model.tripIdToObject(section); - diveListView.model.tripTitle(trip); + diveListView.model.tripTitle(section) } wrapMode: Text.WrapAtWordBoundaryOrAnywhere visible: text !== "" -- cgit v1.2.3-70-g09d2