From 93ba8f1a050b2700613bfe0c9f106ee4bff7e5bf Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Fri, 9 Mar 2018 14:29:32 +0100 Subject: Mobile: for multiple buddies pick index of first When a dive has multiple buddies, pick the index of the first to prevent the user from hanving to scroll through the entire list when editing. Signed-off-by: Joakim Bygdell --- mobile-widgets/qml/DiveDetails.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index 82150cc5b..9cfbbe437 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -242,10 +242,11 @@ Kirigami.Page { watertemp = currentItem.modelData.dive.waterTemp suitIndex = manager.suitList.indexOf(currentItem.modelData.dive.suit) if (currentItem.modelData.dive.buddy.indexOf(",") > 0) { - buddyText = currentItem.modelData.dive.buddy; + buddyIndex = manager.buddyList.indexOf(currentItem.modelData.dive.buddy.split(",", 1).toString()) } else { buddyIndex = manager.buddyList.indexOf(currentItem.modelData.dive.buddy) } + buddyText = currentItem.modelData.dive.buddy; divemasterIndex = manager.divemasterList.indexOf(currentItem.modelData.dive.divemaster) notes = currentItem.modelData.dive.notes if (currentItem.modelData.dive.singleWeight) { -- cgit v1.2.3-70-g09d2