mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile cleanup: unduplicate code and do not loop over dives (3)
See e6e1473e6
. Exact same commit but here for the
list of divemaster. The careful reader will spot a
small addition to the clearDetailsEdit() QML function.
Two more field are cleared.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
parent
572fc47071
commit
83259008e7
7 changed files with 12 additions and 35 deletions
|
@ -241,7 +241,7 @@ Kirigami.Page {
|
|||
} else {
|
||||
buddyIndex = manager.buddyList.indexOf(currentItem.modelData.dive.buddy)
|
||||
}
|
||||
divemasterIndex = currentItem.modelData.dive.divemasterList.indexOf(currentItem.modelData.dive.divemaster)
|
||||
divemasterIndex = manager.divemasterList.indexOf(currentItem.modelData.dive.divemaster)
|
||||
notes = currentItem.modelData.dive.notes
|
||||
if (currentItem.modelData.dive.singleWeight) {
|
||||
// we have only one weight, go ahead, have fun and edit it
|
||||
|
|
|
@ -48,6 +48,8 @@ Item {
|
|||
detailsEdit.depthText = ""
|
||||
detailsEdit.airtempText = ""
|
||||
detailsEdit.watertempText = ""
|
||||
detailsEdit.divemasterText = ""
|
||||
detailsEdit.buddyText = ""
|
||||
suitBox.currentIndex = -1
|
||||
buddyBox.currentIndex = -1
|
||||
divemasterBox.currentIndex = -1
|
||||
|
@ -248,8 +250,7 @@ Item {
|
|||
}
|
||||
HintsTextEdit {
|
||||
id: divemasterBox
|
||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||
diveDetailsListView.currentItem.modelData.dive.divemasterList : null
|
||||
model: manager.divemasterList
|
||||
inputMethodHints: Qt.ImhNoPredictiveText
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ Kirigami.ApplicationWindow {
|
|||
detailsWindow.buddyIndex = -1
|
||||
detailsWindow.buddyText = ""
|
||||
detailsWindow.depth = ""
|
||||
detailsWindow.divemasterModel = manager.divemasterInit
|
||||
detailsWindow.divemasterModel = manager.divemasterList
|
||||
detailsWindow.divemasterIndex = -1
|
||||
detailsWindow.divemasterText = ""
|
||||
detailsWindow.notes = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue