From e993d4f005e62c12765e2e45342ecf840476e3bf Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Fri, 8 Jun 2018 21:43:01 +0200 Subject: [PATCH] mobile: do not call plotDive during startup Check in profile if visible before calling plotDive Signed-off-by: Jan Iversen --- mobile-widgets/qml/DiveDetailsView.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mobile-widgets/qml/DiveDetailsView.qml b/mobile-widgets/qml/DiveDetailsView.qml index bb7a10019..3237fe6f6 100644 --- a/mobile-widgets/qml/DiveDetailsView.qml +++ b/mobile-widgets/qml/DiveDetailsView.qml @@ -217,6 +217,13 @@ Item { border.color: subsurfaceTheme.primaryColor anchors.fill: parent } + + onVisibleChanged: { + if (visible) { + qmlProfile.diveId = model.dive.id; + qmlProfile.update(); + } + } } Controls.Label { id: noProfile @@ -397,8 +404,6 @@ Item { } Component.onCompleted: { qmlProfile.setMargin(Kirigami.Units.smallSpacing) - qmlProfile.diveId = model.dive.id; - qmlProfile.update(); } } }