From 7c2e6461c6be1492ce431537090b11b843b3b231 Mon Sep 17 00:00:00 2001
From: SeeLook <seelook@gmail.com>
Date: Sat, 8 Feb 2025 16:36:56 +0100
Subject: [PATCH] Desktop: updated all QML Connections JS calls

---
 src/qml/ScoreMenuContent.qml        |  6 +++---
 src/qml/instruments/Ukulele.qml     |  2 +-
 src/qml/level/MelodyPage.qml        | 10 +++-------
 src/qml/score/MelGenDialog.qml      |  2 +-
 src/qml/score/Scordature.qml        |  2 +-
 src/qml/settings/GlobalPage.qml     |  3 +--
 src/qml/sound/CountdownItem.qml     |  3 +--
 src/qml/sound/NotesDiffBar.qml      |  2 +-
 src/qml/updater/TupdateSummary.qml  |  2 +-
 src/qml/wizard/WizardClef.qml       |  2 +-
 src/qml/wizard/WizardInstrument.qml |  3 +--
 src/qml/wizard/WizardSax.qml        |  2 +-
 12 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/src/qml/ScoreMenuContent.qml b/src/qml/ScoreMenuContent.qml
index 5550849a..68ab28e4 100644
--- a/src/qml/ScoreMenuContent.qml
+++ b/src/qml/ScoreMenuContent.qml
@@ -43,7 +43,7 @@ Tmenu {
 
     Connections {
         target: score.notesMenuAct
-        onTriggered: {
+        function onTriggered() : void {
             notesLoader.active = true;
             notesLoader.item.open();
             close();
@@ -123,8 +123,8 @@ Tmenu {
 
     Connections {
         target: score.transposeAct
-        onTriggered: {
-            var tPop = transComp.createObject(nootkaWindow);
+        function onTriggered() : void {
+            let tPop = transComp.createObject(nootkaWindow);
             tPop.initKey = score.keySignature;
             close();
         }
diff --git a/src/qml/instruments/Ukulele.qml b/src/qml/instruments/Ukulele.qml
index 480d6ffa..7ccdec66 100644
--- a/src/qml/instruments/Ukulele.qml
+++ b/src/qml/instruments/Ukulele.qml
@@ -142,7 +142,7 @@ TguitarBg {
     Connections {
         target: instrFlick
         enabled: !NOO.isAndroid()
-        onMovementEnded: instrument.pressedAt(0, 0)
+        function onMovementEnded() : void { instrument.pressedAt(0, 0) }
     }
 
     MouseArea {
diff --git a/src/qml/level/MelodyPage.qml b/src/qml/level/MelodyPage.qml
index 3de5dc92..2ecb11f9 100644
--- a/src/qml/level/MelodyPage.qml
+++ b/src/qml/level/MelodyPage.qml
@@ -256,24 +256,20 @@ Tflickable {
                         bold: true
                         pixelSize: NOO.factor() * 0.9
                     }
-
                 }
-
             }
-
         }
-
     }
 
     Connections {
         target: creator
-        onUpdateNotesList: updateNotesList()
-        onUpdateMelodyList: checkMelodyView()
+        function onUpdateNotesList() : void { updateNotesList() }
+        function onUpdateMelodyList() : void { checkMelodyView() }
     }
 
     Connections {
         target: melCombo
-        onCurrentIndexChanged: checkMelodyView()
+        function onCurrentIndexChanged() : void { checkMelodyView() }
     }
 
 }
diff --git a/src/qml/score/MelGenDialog.qml b/src/qml/score/MelGenDialog.qml
index 62dd7ad0..dfa7ec09 100644
--- a/src/qml/score/MelGenDialog.qml
+++ b/src/qml/score/MelGenDialog.qml
@@ -149,7 +149,7 @@ TmelGenItem {
 
     Connections {
         target: genButt
-        onClicked: {
+        function onClicked() : void {
             generate();
             dialLoader.close();
         }
diff --git a/src/qml/score/Scordature.qml b/src/qml/score/Scordature.qml
index 6b03608a..0353da12 100644
--- a/src/qml/score/Scordature.qml
+++ b/src/qml/score/Scordature.qml
@@ -65,7 +65,7 @@ Grid {
 
     Connections {
         target: GLOB
-        onNoteNameStyleChanged: {
+        function onNoteNameStyleChanged() : void {
             for (var s = 0; s < scordModel.count; ++s) scordModel.get(s).name = GLOB.tuning.stringName(scordModel.get(s).strNr)
         }
     }
diff --git a/src/qml/settings/GlobalPage.qml b/src/qml/settings/GlobalPage.qml
index 9e29e1d8..a7334794 100644
--- a/src/qml/settings/GlobalPage.qml
+++ b/src/qml/settings/GlobalPage.qml
@@ -361,10 +361,9 @@ Tflickable {
 
     Connections {
         target: dialogObj
-        onUpdateSummary: {
+        function onUpdateSummary() : void {
             if (!updater)
                 updater = Qt.createComponent("qrc:/updater/UpdaterPopup.qml").createObject(globalPage);
-
             updater.open();
         }
     }
diff --git a/src/qml/sound/CountdownItem.qml b/src/qml/sound/CountdownItem.qml
index 2b74a010..6cd26f1e 100644
--- a/src/qml/sound/CountdownItem.qml
+++ b/src/qml/sound/CountdownItem.qml
@@ -23,10 +23,9 @@ TipRect {
 
     Connections {
         target: tempoBar
-        onCntChanged: {
+        function onCntChanged() : void {
             if (SOUND.metroRunning)
                 counter++;
-
         }
     }
 
diff --git a/src/qml/sound/NotesDiffBar.qml b/src/qml/sound/NotesDiffBar.qml
index 584a7193..5051195b 100644
--- a/src/qml/sound/NotesDiffBar.qml
+++ b/src/qml/sound/NotesDiffBar.qml
@@ -91,7 +91,7 @@ TnotesBarItem {
 
     Connections {
         target: GLOB
-        onGuitarParamsChanged: setAmbitus(GLOB.loNote(), GLOB.hiNote())
+        function onGuitarParamsChanged() : void { setAmbitus(GLOB.loNote(), GLOB.hiNote()) }
     }
 
 }
diff --git a/src/qml/updater/TupdateSummary.qml b/src/qml/updater/TupdateSummary.qml
index d4f3653e..d22c11d6 100644
--- a/src/qml/updater/TupdateSummary.qml
+++ b/src/qml/updater/TupdateSummary.qml
@@ -22,7 +22,7 @@ TupdateItem {
 
     Connections {
         target: dialogObj
-        onUpdateSummary: {
+        function onUpdateSummary(version: string, changes: string, rules: var) : void {
             console.log(version);
             updateIt.version = version;
             updateIt.changes = changes;
diff --git a/src/qml/wizard/WizardClef.qml b/src/qml/wizard/WizardClef.qml
index 814ecadc..e3410c56 100644
--- a/src/qml/wizard/WizardClef.qml
+++ b/src/qml/wizard/WizardClef.qml
@@ -84,7 +84,7 @@ Tflickable {
 
     Connections {
         target: nootkaWindow
-        onInstrumentChanged: changeInstrument()
+        function onInstrumentChanged() : void { changeInstrument() }
     }
 
 }
diff --git a/src/qml/wizard/WizardInstrument.qml b/src/qml/wizard/WizardInstrument.qml
index a2420956..6f1c6c9c 100644
--- a/src/qml/wizard/WizardInstrument.qml
+++ b/src/qml/wizard/WizardInstrument.qml
@@ -63,10 +63,9 @@ Tflickable {
 
     Connections {
         target: nootkaWindow.swipe
-        onCurrentIndexChanged: {
+        function onCurrentIndexChanged() : void {
             if (nootkaWindow.swipe.currentIndex != 1 && instrPage.instrument != instrSel.instrument)
                 instrPage.instrument = instrSel.instrument;
-
         }
     }
 
diff --git a/src/qml/wizard/WizardSax.qml b/src/qml/wizard/WizardSax.qml
index 0fc2deb0..87eea419 100644
--- a/src/qml/wizard/WizardSax.qml
+++ b/src/qml/wizard/WizardSax.qml
@@ -83,7 +83,7 @@ Column {
 
     Connections {
         target: nootkaWindow
-        onInstrumentChanged: transpose.shift = NOO.instr(nootkaWindow.instrument).transposition
+        function onInstrumentChanged() : void { transpose.shift = NOO.instr(nootkaWindow.instrument).transposition }
     }
 
 }
-- 
GitLab