Mobile: don't dereference the dive list model when it's disconnected

This avoids a bunch of annoying warnings.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-10-30 10:18:15 +01:00
parent 9f34f4f97d
commit f1e7adfedc

View file

@ -361,7 +361,7 @@ Kirigami.ScrollablePage {
}
Controls.Label {
text: {
diveListView.model.tripShortDate(section)
diveListView.model ? diveListView.model.tripShortDate(section) : "no data model"
}
color: subsurfaceTheme.primaryTextColor
font.pointSize: subsurfaceTheme.smallPointSize
@ -386,7 +386,7 @@ Kirigami.ScrollablePage {
Controls.Label {
id: sectionText
text: {
diveListView.model.tripTitle(section)
diveListView.model ? diveListView.model.tripTitle(section) : "no data model"
}
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
visible: text !== ""