mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile: more code to deal with undefined elements
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
dc5f22d047
commit
4c55074bd7
1 changed files with 11 additions and 9 deletions
|
@ -216,7 +216,8 @@ Kirigami.Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
onCurrentItemChanged: {
|
onCurrentItemChanged: {
|
||||||
// why do we do this? What consumes this?
|
if (currentItem && currentItem.modelData) {
|
||||||
|
// this is used when loading dives to maintain relative position in the dive list
|
||||||
manager.selectedDiveTimestamp = currentItem.modelData.date
|
manager.selectedDiveTimestamp = currentItem.modelData.date
|
||||||
// make sure the core data structures reflect that this dive is selected
|
// make sure the core data structures reflect that this dive is selected
|
||||||
manager.selectDive(currentItem.modelData.id)
|
manager.selectDive(currentItem.modelData.id)
|
||||||
|
@ -226,6 +227,7 @@ Kirigami.Page {
|
||||||
mapPage.centerOnDiveSite(currentItem.modelData.diveSite)
|
mapPage.centerOnDiveSite(currentItem.modelData.diveSite)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function showDiveIndex(index) {
|
function showDiveIndex(index) {
|
||||||
currentIndex = index;
|
currentIndex = index;
|
||||||
|
@ -256,7 +258,7 @@ Kirigami.Page {
|
||||||
dive_id = modelData.id
|
dive_id = modelData.id
|
||||||
number = modelData.number
|
number = modelData.number
|
||||||
date = modelData.dateTime
|
date = modelData.dateTime
|
||||||
location = modelData.location
|
location = modelData.location !== undefined ? location : ""
|
||||||
locationIndex = manager.locationList.indexOf(modelData.location)
|
locationIndex = manager.locationList.indexOf(modelData.location)
|
||||||
gps = modelData.gps
|
gps = modelData.gps
|
||||||
gpsCheckbox = false
|
gpsCheckbox = false
|
||||||
|
|
Loading…
Add table
Reference in a new issue