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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-09-14 19:58:30 +02:00 committed by Dirk Hohndel
parent ce751bd696
commit 9322c54b6a
3 changed files with 12 additions and 15 deletions

View file

@ -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 !== ""