From d2f337274956a5aefc206c63ac12b8204fe17f9a Mon Sep 17 00:00:00 2001 From: Konrad Materka Date: Wed, 11 Nov 2020 17:44:38 +0100 Subject: [PATCH] Fix Connections warnings Qt 5.15 introduced new syntax for defining Connections. Fix warnings like this one: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo() { ... } --- kcmkwin/kwindecoration/package/contents/ui/Themes.qml | 8 ++++++-- kcmkwin/kwindecoration/package/contents/ui/main.qml | 4 +++- kcmkwin/kwindesktop/package/contents/ui/main.qml | 4 ++-- kcmkwin/kwineffects/package/contents/ui/Video.qml | 2 +- .../themes/plastik/package/contents/ui/PlastikButton.qml | 8 ++++++-- .../aurorae/themes/plastik/package/contents/ui/main.qml | 8 ++++++-- qml/outline/plasma/outline.qml | 2 +- scripts/desktopchangeosd/contents/ui/main.qml | 2 +- scripts/desktopchangeosd/contents/ui/osd.qml | 6 ++++-- tests/pointerconstraintstest.qml | 2 +- 10 files changed, 31 insertions(+), 15 deletions(-) diff --git a/kcmkwin/kwindecoration/package/contents/ui/Themes.qml b/kcmkwin/kwindecoration/package/contents/ui/Themes.qml index 591bd5824e..67a9e44779 100644 --- a/kcmkwin/kwindecoration/package/contents/ui/Themes.qml +++ b/kcmkwin/kwindecoration/package/contents/ui/Themes.qml @@ -77,7 +77,9 @@ KCM.GridView { } Connections { target: kcm - onBorderSizeChanged: settingsItem.borderSizesIndex = kcm.borderSize + function onBorderSizeChanged() { + settingsItem.borderSizesIndex = kcm.borderSize + } } } actions: [ @@ -100,7 +102,9 @@ KCM.GridView { } Connections { target: kcm - onThemeChanged: view.currentIndex = kcm.theme + function onThemeChanged() { + view.currentIndex = kcm.theme + } } } diff --git a/kcmkwin/kwindecoration/package/contents/ui/main.qml b/kcmkwin/kwindecoration/package/contents/ui/main.qml index 36fb88b7d4..0380018bce 100644 --- a/kcmkwin/kwindecoration/package/contents/ui/main.qml +++ b/kcmkwin/kwindecoration/package/contents/ui/main.qml @@ -121,7 +121,9 @@ Kirigami.Page { Connections { target: kcm - onThemeChanged: borderSizeComboBox.autoBorderUpdate() + function onThemeChanged() { + borderSizeComboBox.autoBorderUpdate() + } } } Item { diff --git a/kcmkwin/kwindesktop/package/contents/ui/main.qml b/kcmkwin/kwindesktop/package/contents/ui/main.qml index d18ac3c9f1..c7b3603847 100644 --- a/kcmkwin/kwindesktop/package/contents/ui/main.qml +++ b/kcmkwin/kwindesktop/package/contents/ui/main.qml @@ -20,11 +20,11 @@ ScrollViewKCM { Connections { target: kcm.desktopsModel - onReadyChanged: { + function onReadyChanged() { rowsSpinBox.value = kcm.desktopsModel.rows; } - onRowsChanged: { + function onRowsChanged() { rowsSpinBox.value = kcm.desktopsModel.rows; } } diff --git a/kcmkwin/kwineffects/package/contents/ui/Video.qml b/kcmkwin/kwineffects/package/contents/ui/Video.qml index f089bd6c57..f67461cc73 100644 --- a/kcmkwin/kwineffects/package/contents/ui/Video.qml +++ b/kcmkwin/kwineffects/package/contents/ui/Video.qml @@ -35,7 +35,7 @@ Multimedia.Video { } Connections { target: videoItem - onStopped: { + function onStopped() { replayButton.visible = true } } diff --git a/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/PlastikButton.qml b/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/PlastikButton.qml index 4eb7b0e525..9568527bfc 100644 --- a/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/PlastikButton.qml +++ b/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/PlastikButton.qml @@ -140,10 +140,14 @@ DecorationButton { onPressedChanged: colorize() Connections { target: decoration.client - onActiveChanged: button.colorize() + function onActiveChanged() { + button.colorize() + } } Connections { target: options - onColorsChanged: button.colorize(); + function onColorsChanged() { + button.colorize(); + } } } diff --git a/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/main.qml b/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/main.qml index b0d0886c8d..46443160b6 100644 --- a/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/main.qml +++ b/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/main.qml @@ -405,10 +405,14 @@ Decoration { } Connections { target: decoration - onConfigChanged: root.readConfig() + function onConfigChanged() { + root.readConfig() + } } Connections { target: decorationSettings - onBorderSizeChanged: root.readBorderSize(); + function onBorderSizeChanged() { + root.readBorderSize(); + } } } diff --git a/qml/outline/plasma/outline.qml b/qml/outline/plasma/outline.qml index 4d03324cfd..80c1b51f25 100644 --- a/qml/outline/plasma/outline.qml +++ b/qml/outline/plasma/outline.qml @@ -47,7 +47,7 @@ Window { target: outline // when unified geometry changes, this means our window position changed and any // animation will potentially be offset and/or cut off, skip the animation in this case - onUnifiedGeometryChanged: { + function onUnifiedGeometryChanged() { if (window.visible) { window.animationEnabled = false svg.setGeometry(outline.geometry) diff --git a/scripts/desktopchangeosd/contents/ui/main.qml b/scripts/desktopchangeosd/contents/ui/main.qml index fc8544df52..29f941d97f 100644 --- a/scripts/desktopchangeosd/contents/ui/main.qml +++ b/scripts/desktopchangeosd/contents/ui/main.qml @@ -17,7 +17,7 @@ Item { Connections { target: workspace - onCurrentDesktopChanged: { + function onCurrentDesktopChanged() { if (!mainItemLoader.item) { mainItemLoader.source = "osd.qml"; } diff --git a/scripts/desktopchangeosd/contents/ui/osd.qml b/scripts/desktopchangeosd/contents/ui/osd.qml index 942ebefed2..bb12c9ba35 100644 --- a/scripts/desktopchangeosd/contents/ui/osd.qml +++ b/scripts/desktopchangeosd/contents/ui/osd.qml @@ -277,13 +277,15 @@ PlasmaCore.Dialog { Connections { target: workspace onCurrentDesktopChanged: dialogItem.show() - onNumberDesktopsChanged: { + function onNumberDesktopsChanged() { repeater.model = workspace.desktops; } } Connections { target: options - onConfigChanged: dialogItem.loadConfig() + function onConfigChanged() { + dialogItem.loadConfig() + } } Component.onCompleted: { view.columns = workspace.desktopGridWidth; diff --git a/tests/pointerconstraintstest.qml b/tests/pointerconstraintstest.qml index 85e8aac71d..4014343d18 100644 --- a/tests/pointerconstraintstest.qml +++ b/tests/pointerconstraintstest.qml @@ -67,7 +67,7 @@ ColumnLayout { Connections { target: org_kde_kwin_tests_pointerconstraints_backend - onForceSurfaceCommit: { + function onForceSurfaceCommit() { forceCommitRect.visible = true } }