mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +00:00
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>
This commit is contained in:
parent
adaaaaf32b
commit
6dd3e4c30e
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue