From 07fb1db3ad5652b7df74f790d1c547a4d9bc3803 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Fri, 9 Mar 2018 14:49:15 +0100 Subject: Mobile: Fix location combobox In the initial move to comboboxes the correct location model was not used. This uses the correct model and makes it behave like the other comboboxes. Signed-off-by: Joakim Bygdell --- mobile-widgets/qml/DiveDetails.qml | 2 ++ mobile-widgets/qml/DiveDetailsEdit.qml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index 9cfbbe437..f82c069bb 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -26,6 +26,7 @@ Kirigami.Page { property alias duration: detailsEdit.durationText property alias location: detailsEdit.locationText property alias locationModel: detailsEdit.locationModel + property alias locationIndex: detailsEdit.locationIndex property alias gps: detailsEdit.gpsText property alias notes: detailsEdit.notesText property alias suitIndex: detailsEdit.suitIndex @@ -234,6 +235,7 @@ Kirigami.Page { number = currentItem.modelData.dive.number date = currentItem.modelData.dive.date + " " + currentItem.modelData.dive.time location = currentItem.modelData.dive.location + locationIndex = manager.locationList.indexOf(currentItem.modelData.dive.location) gps = currentItem.modelData.dive.gps gpsCheckbox = false duration = currentItem.modelData.dive.duration diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml index 4e3b956f0..d91dfbef8 100644 --- a/mobile-widgets/qml/DiveDetailsEdit.qml +++ b/mobile-widgets/qml/DiveDetailsEdit.qml @@ -12,6 +12,7 @@ Item { property int number property alias dateText: txtDate.text property alias locationText: txtLocation.editText + property alias locationIndex: txtLocation.currentIndex property alias gpsText: txtGps.text property alias airtempText: txtAirTemp.text property alias watertempText: txtWaterTemp.text @@ -136,7 +137,7 @@ Item { editable: true flat: true model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? - diveDetailsListView.currentItem.modelData.dive.locationList : null + manager.locationList : null inputMethodHints: Qt.ImhNoPredictiveText Layout.fillWidth: true onAccepted: { -- cgit v1.2.3-70-g09d2