Mobile: Fix QML Warnings.

Fix some runtime warnings when running the mobile build caused by
binding loops and deprecated handler syntax.

Signed-off-by: Michael Keller <mikeller@042.ch>
This commit is contained in:
Michael Keller 2024-05-28 14:20:55 +12:00
parent d9f50bb8e0
commit a39f0e2891
6 changed files with 22 additions and 15 deletions

View file

@ -399,8 +399,6 @@ Kirigami.Page {
delegate: Flickable {
id: internalScrollView
width: diveDetailsListView.width
height: diveDetailsListView.height
contentHeight: diveDetails.height
boundsBehavior: Flickable.StopAtBounds
property var modelData: model
DiveDetailsView {
@ -413,7 +411,7 @@ Kirigami.Page {
ScrollIndicator.horizontal: ScrollIndicator { }
Connections {
target: swipeModel
onCurrentDiveChanged: {
function onCurrentDiveChanged(index) {
currentIndex = index.row
diveDetailsListView.positionViewAtIndex(currentIndex, ListView.End)
}
@ -425,7 +423,6 @@ Kirigami.Page {
anchors.fill: parent
leftMargin: Kirigami.Units.smallSpacing
rightMargin: Kirigami.Units.smallSpacing
contentHeight: detailsEdit.height
// start invisible and scaled down, to get the transition
// off to the right start
visible: false

View file

@ -19,7 +19,7 @@ Item {
Connections {
target: rootItem
onSettingsChanged: {
function onSettingsChanged() {
qmlProfile.update()
}
}

View file

@ -32,10 +32,10 @@ Kirigami.ScrollablePage {
}
Connections {
target: Backend
onLengthChanged: {
function onLengthChanged() {
reload()
}
onVolumeChanged: {
function onVolumeChanged() {
reload()
}
}

View file

@ -318,7 +318,7 @@ Kirigami.Page {
Connections {
target: manager
onRestartDownloadSignal: {
function onRestartDownloadSignal() {
buttonBar.doDownload()
}
}

View file

@ -111,14 +111,14 @@ TemplatePage {
}
Connections {
target: manager
onUploadFinish: {
function onUploadFinish(success, text) {
if (success) {
pageStack.pop()
}
statusText.text = text
progress.value = 0
}
onUploadProgress: {
function onUploadProgress(percentage) {
progress.value = percentage
}
}

View file

@ -110,7 +110,9 @@ Kirigami.Page {
model: statsManager.var1List
currentIndex: statsManager.var1Index
onCurrentIndexChanged: {
statsManager.var1Changed(currentIndex)
if (currentIndex != statsManager.var1Index) {
statsManager.var1Changed(currentIndex)
}
}
}
}
@ -127,7 +129,9 @@ Kirigami.Page {
model: statsManager.binner1List
currentIndex: statsManager.binner1Index
onCurrentIndexChanged: {
statsManager.var1BinnerChanged(currentIndex)
if (currentIndex != statsManager.binner1Index) {
statsManager.var1BinnerChanged(currentIndex)
}
}
}
}
@ -145,7 +149,9 @@ Kirigami.Page {
currentIndex: statsManager.var2Index
Layout.fillWidth: false
onCurrentIndexChanged: {
statsManager.var2Changed(currentIndex)
if (currentIndex != statsManager.var2Index) {
statsManager.var2Changed(currentIndex)
}
}
}
}
@ -163,7 +169,9 @@ Kirigami.Page {
currentIndex: statsManager.binner2Index
Layout.fillWidth: false
onCurrentIndexChanged: {
statsManager.var2BinnerChanged(currentIndex)
if (currentIndex != statsManager.binner2Index) {
statsManager.var2BinnerChanged(currentIndex)
}
}
}
}
@ -181,7 +189,9 @@ Kirigami.Page {
currentIndex: statsManager.operation2Index
Layout.fillWidth: false
onCurrentIndexChanged: {
statsManager.var2OperationChanged(currentIndex)
if (currentIndex != statsManager.operation2Index) {
statsManager.var2OperationChanged(currentIndex)
}
}
}
}