mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: don't access members of undefined objects
If we don't have a currentItem, don't try to access its members. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
33df10cbaa
commit
9389fd0049
2 changed files with 5 additions and 5 deletions
|
|
@ -49,7 +49,7 @@ Kirigami.Page {
|
||||||
target: diveDetailsPage;
|
target: diveDetailsPage;
|
||||||
actions {
|
actions {
|
||||||
right: deleteAction
|
right: deleteAction
|
||||||
left: diveDetailsListView.currentItem.modelData.dive.gps !== "" ? mapAction : null
|
left: diveDetailsListView.currentItem ? (diveDetailsListView.currentItem.modelData.dive.gps !== "" ? mapAction : null) : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PropertyChanges { target: detailsEditScroll; opened: false }
|
PropertyChanges { target: detailsEditScroll; opened: false }
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ Item {
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: suitBox
|
id: suitBox
|
||||||
editable: true
|
editable: true
|
||||||
model: diveDetailsListView.currentItem.modelData.dive.suitList
|
model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.suitList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
style: ComboBoxStyle {
|
style: ComboBoxStyle {
|
||||||
|
|
@ -178,7 +178,7 @@ Item {
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: buddyBox
|
id: buddyBox
|
||||||
editable: true
|
editable: true
|
||||||
model: diveDetailsListView.currentItem.modelData.dive.buddyList
|
model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.buddyList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
style: ComboBoxStyle {
|
style: ComboBoxStyle {
|
||||||
|
|
@ -193,7 +193,7 @@ Item {
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: divemasterBox
|
id: divemasterBox
|
||||||
editable: true
|
editable: true
|
||||||
model: diveDetailsListView.currentItem.modelData.dive.divemasterList
|
model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.divemasterList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
style: ComboBoxStyle {
|
style: ComboBoxStyle {
|
||||||
|
|
@ -218,7 +218,7 @@ Item {
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: cylinderBox
|
id: cylinderBox
|
||||||
editable: true
|
editable: true
|
||||||
model: diveDetailsListView.currentItem.modelData.dive.cylinderList
|
model: diveDetailsListView.currentItem ? diveDetailsListView.currentItem.modelData.dive.cylinderList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
style: ComboBoxStyle {
|
style: ComboBoxStyle {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue