From b01e9fb0a833e5cc2da16ae7d1bb1f2a6e92b465 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 6 Nov 2019 06:07:19 +0100 Subject: Mobile: derive the index from the dive id The previous code assumes that both the vertical dive list and the list of dive details which allows the horizontal swiping from dive to dive are based on the same model. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveDetails.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index e6862ac6a..a94de4f51 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -229,9 +229,9 @@ Kirigami.Page { } } - function showDiveIndex(index) { - currentIndex = index; - diveDetailsListView.positionViewAtIndex(index, ListView.End); + function showDiveIndex(id) { + currentIndex = diveModel.getIdxForId(id); + diveDetailsListView.positionViewAtIndex(currentIndex, ListView.End); } function endEditMode() { -- cgit v1.2.3-70-g09d2