diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-01-28 18:31:24 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-28 18:33:22 -0800 |
commit | 6dd3e4c30e50a839d840194d4df7613b2e87585f (patch) | |
tree | 4564b021919cd0b9e3e05d786ea2e5f14e516329 /qt-mobile/qml | |
parent | adaaaaf32be802ce8dbc1d336a94dde24abecef3 (diff) | |
download | subsurface-6dd3e4c30e50a839d840194d4df7613b2e87585f.tar.gz |
QML UI: use the new helper to ensure the right dive is selected after edit
There are two cases where this is important
- when running Manually add dive which may add a dive in the middle of the
dive list
- when editing the date and time of a dive which may move it around in the
dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qml')
-rw-r--r-- | qt-mobile/qml/DiveDetailsEdit.qml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-mobile/qml/DiveDetailsEdit.qml b/qt-mobile/qml/DiveDetailsEdit.qml index 992f620ff..1c6c4a0f5 100644 --- a/qt-mobile/qml/DiveDetailsEdit.qml +++ b/qt-mobile/qml/DiveDetailsEdit.qml @@ -169,7 +169,10 @@ Item { manager.commitChanges(dive_id, detailsEdit.dateText, detailsEdit.locationText, detailsEdit.gpsText, detailsEdit.durationText, detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText, detailsEdit.suitText, detailsEdit.buddyText, detailsEdit.divemasterText, detailsEdit.notesText) - // apply the changes to the dive detail view + // apply the changes to the dive detail view - since the edit could have changed the order + // first make sure that we are looking at the correct dive - our model allows us to look + // up the index based on the unique dive_id + diveDetailsListView.currentIndex = diveModel.getIdxForId(dive_id) diveDetailsListView.currentItem.modelData.date = detailsEdit.dateText diveDetailsListView.currentItem.modelData.location = detailsEdit.locationText diveDetailsListView.currentItem.modelData.duration = detailsEdit.durationText |