diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-11-06 06:07:19 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-11-08 20:50:05 +0100 |
commit | b01e9fb0a833e5cc2da16ae7d1bb1f2a6e92b465 (patch) | |
tree | b222928003d9130a5f373b7e658495fe24363fef | |
parent | 26371063097dab646fcc33afad99943e4376d621 (diff) | |
download | subsurface-b01e9fb0a833e5cc2da16ae7d1bb1f2a6e92b465.tar.gz |
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 <dirk@hohndel.org>
-rw-r--r-- | mobile-widgets/qml/DiveDetails.qml | 6 |
1 files changed, 3 insertions, 3 deletions
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() { |