From 5abed2ddbfc6655a3e54b2ec47c8a77329dc896b Mon Sep 17 00:00:00 2001 From: Konrad Materka Date: Mon, 9 Nov 2020 22:52:25 +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() { ... } --- .../package/contents/ui/PopupDialog.qml | 8 ++++++-- .../package/contents/ui/DeviceItem.qml | 2 +- .../package/contents/ui/FullRepresentation.qml | 4 ++-- .../package/contents/ui/CalendarView.qml | 4 ++-- applets/icon/package/contents/ui/main.qml | 4 +++- .../contents/ui/ExpandedRepresentation.qml | 2 +- .../package/contents/ui/FullRepresentation.qml | 2 +- .../package/contents/ui/NotificationHeader.qml | 4 +++- .../contents/ui/config/ConfigAppearance.qml | 4 +++- .../package/contents/ui/config/ConfigSensors.qml | 4 +++- .../package/contents/ui/config/FaceDetails.qml | 4 +++- kcms/colors/package/contents/ui/main.qml | 6 +++--- kcms/cursortheme/package/contents/ui/Delegate.qml | 2 +- kcms/cursortheme/package/contents/ui/main.qml | 6 +++--- kcms/desktoptheme/package/contents/ui/main.qml | 4 ++-- kcms/fonts/package/contents/ui/main.qml | 14 ++++++++++---- kcms/icons/package/contents/ui/IconSizePopup.qml | 2 +- kcms/icons/package/contents/ui/main.qml | 4 ++-- kcms/style/package/contents/ui/GtkStylePage.qml | 4 ++-- kcms/style/package/contents/ui/main.qml | 4 ++-- kcms/translations/package/contents/ui/main.qml | 4 +++- .../contents/desktopswitcher/DesktopSwitcher.qml | 2 +- lookandfeel/contents/runcommand/RunCommand.qml | 2 +- .../contents/windowswitcher/WindowSwitcher.qml | 2 +- .../image/imagepackage/contents/ui/config.qml | 6 +++--- .../platformcontents/phone/ui/config.qml | 4 +++- .../platformcontents/touch/ui/config.qml | 4 +++- 27 files changed, 69 insertions(+), 43 deletions(-) diff --git a/applets/batterymonitor/package/contents/ui/PopupDialog.qml b/applets/batterymonitor/package/contents/ui/PopupDialog.qml index e50364b8b..5c0dd670a 100644 --- a/applets/batterymonitor/package/contents/ui/PopupDialog.qml +++ b/applets/batterymonitor/package/contents/ui/PopupDialog.qml @@ -78,7 +78,9 @@ PlasmaComponents3.Page { // Manually dragging the slider around breaks the binding Connections { target: batterymonitor - onScreenBrightnessChanged: brightnessSlider.value = batterymonitor.screenBrightness + function onScreenBrightnessChanged() { + brightnessSlider.value = batterymonitor.screenBrightness + } } } @@ -100,7 +102,9 @@ PlasmaComponents3.Page { // Manually dragging the slider around breaks the binding Connections { target: batterymonitor - onKeyboardBrightnessChanged: keyboardBrightnessSlider.value = batterymonitor.keyboardBrightness + function onKeyboardBrightnessChanged() { + keyboardBrightnessSlider.value = batterymonitor.keyboardBrightness + } } } } diff --git a/applets/devicenotifier/package/contents/ui/DeviceItem.qml b/applets/devicenotifier/package/contents/ui/DeviceItem.qml index 0fff1d5a8..4d2a4aba7 100644 --- a/applets/devicenotifier/package/contents/ui/DeviceItem.qml +++ b/applets/devicenotifier/package/contents/ui/DeviceItem.qml @@ -64,7 +64,7 @@ PlasmaExtras.ExpandableListItem { Connections { target: unmountAll - onClicked: { + function onClicked() { if (model["Removable"] && isMounted) { actionTriggered(); } diff --git a/applets/devicenotifier/package/contents/ui/FullRepresentation.qml b/applets/devicenotifier/package/contents/ui/FullRepresentation.qml index b45b4cd73..a2d4ad742 100644 --- a/applets/devicenotifier/package/contents/ui/FullRepresentation.qml +++ b/applets/devicenotifier/package/contents/ui/FullRepresentation.qml @@ -96,7 +96,7 @@ PlasmaComponents3.Page { Connections { target: statusSource - onLastChanged: { + function onLastChanged() { if (!statusSource.last) { messageHighlightAnimator.stop() messageHighlight.visible = false @@ -116,7 +116,7 @@ PlasmaComponents3.Page { Connections { target: plasmoid - onExpandedChanged: { + function onExpandedChanged(expanded) { if (!plasmoid.expanded) { statusSource.clearMessage(); } diff --git a/applets/digital-clock/package/contents/ui/CalendarView.qml b/applets/digital-clock/package/contents/ui/CalendarView.qml index 2dc7f4c1b..ba3575395 100644 --- a/applets/digital-clock/package/contents/ui/CalendarView.qml +++ b/applets/digital-clock/package/contents/ui/CalendarView.qml @@ -209,7 +209,7 @@ PlasmaComponents3.Page { Connections { target: monthView - onCurrentDateChanged: { + function onCurrentDateChanged() { // Apparently this is needed because this is a simple QList being // returned and if the list for the current day has 1 event and the // user clicks some other date which also has 1 event, QML sees the @@ -224,7 +224,7 @@ PlasmaComponents3.Page { Connections { target: monthView.daysModel - onAgendaUpdated: { + function onAgendaUpdated(updatedDate) { if (agenda.dateEquals(updatedDate, monthView.currentDate)) { holidaysList.model = null; holidaysList.model = monthView.daysModel.eventsForDate(monthView.currentDate); diff --git a/applets/icon/package/contents/ui/main.qml b/applets/icon/package/contents/ui/main.qml index fc441d474..bd1b69763 100644 --- a/applets/icon/package/contents/ui/main.qml +++ b/applets/icon/package/contents/ui/main.qml @@ -79,7 +79,9 @@ MouseArea { Connections { target: plasmoid - onExternalData: plasmoid.nativeInterface.url = data + function onExternalData(mimetype, data) { + plasmoid.nativeInterface.url = data + } } DragDrop.DropArea { diff --git a/applets/mediacontroller/contents/ui/ExpandedRepresentation.qml b/applets/mediacontroller/contents/ui/ExpandedRepresentation.qml index 62d0a5686..c58caa91f 100644 --- a/applets/mediacontroller/contents/ui/ExpandedRepresentation.qml +++ b/applets/mediacontroller/contents/ui/ExpandedRepresentation.qml @@ -59,7 +59,7 @@ PlasmaComponents3.Page { Connections { target: plasmoid - onExpandedChanged: { + function onExpandedChanged(expanded) { if (plasmoid.expanded) { retrievePosition(); } diff --git a/applets/notifications/package/contents/ui/FullRepresentation.qml b/applets/notifications/package/contents/ui/FullRepresentation.qml index a0f2bef28..edec42a1e 100644 --- a/applets/notifications/package/contents/ui/FullRepresentation.qml +++ b/applets/notifications/package/contents/ui/FullRepresentation.qml @@ -49,7 +49,7 @@ PlasmaComponents3.Page { Connections { target: plasmoid - onExpandedChanged: { + function onExpandedChanged(expanded) { if (plasmoid.expanded) { list.positionViewAtBeginning(); list.currentIndex = -1; diff --git a/applets/notifications/package/contents/ui/NotificationHeader.qml b/applets/notifications/package/contents/ui/NotificationHeader.qml index 7a196ac26..949a08624 100644 --- a/applets/notifications/package/contents/ui/NotificationHeader.qml +++ b/applets/notifications/package/contents/ui/NotificationHeader.qml @@ -78,7 +78,9 @@ RowLayout { Connections { target: Globals // clock time changed - onTimeChanged: notificationHeading.updateAgoText() + function onTimeChanged() { + notificationHeading.updateAgoText() + } } PlasmaCore.IconItem { diff --git a/applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigAppearance.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigAppearance.qml index 7ddc17cc1..71dfc747e 100644 --- a/applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigAppearance.qml +++ b/applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigAppearance.qml @@ -45,6 +45,8 @@ QQC2.Control { Connections { target: contentItem - onConfigurationChanged: root.configurationChanged() + function onConfigurationChanged() { + root.configurationChanged() + } } } diff --git a/applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigSensors.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigSensors.qml index 88eac8e79..ba57966d4 100644 --- a/applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigSensors.qml +++ b/applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigSensors.qml @@ -47,6 +47,8 @@ QQC2.Control { Connections { target: contentItem - onConfigurationChanged: root.configurationChanged() + function onConfigurationChanged() { + root.configurationChanged() + } } } diff --git a/applets/systemmonitor/systemmonitor/package/contents/ui/config/FaceDetails.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/config/FaceDetails.qml index 89045739b..18dd52818 100644 --- a/applets/systemmonitor/systemmonitor/package/contents/ui/config/FaceDetails.qml +++ b/applets/systemmonitor/systemmonitor/package/contents/ui/config/FaceDetails.qml @@ -40,6 +40,8 @@ QQC2.Control { Connections { target: contentItem - onConfigurationChanged: root.configurationChanged() + function onConfigurationChanged() { + root.configurationChanged() + } } } diff --git a/kcms/colors/package/contents/ui/main.qml b/kcms/colors/package/contents/ui/main.qml index 9ec20516f..c37c9ed06 100644 --- a/kcms/colors/package/contents/ui/main.qml +++ b/kcms/colors/package/contents/ui/main.qml @@ -84,7 +84,7 @@ KCM.GridViewKCM { Connections { target: kcm - onShowSchemeNotInstalledWarning: { + function onShowSchemeNotInstalledWarning(schemeName) { notInstalledWarning.text = i18n("The color scheme '%1' is not installed. Selecting the default theme instead.", schemeName) notInstalledWarning.visible = true; } @@ -295,14 +295,14 @@ KCM.GridViewKCM { Connections { target: kcm - onShowSuccessMessage: { + function onShowSuccessMessage(message) { infoLabel.type = Kirigami.MessageType.Positive; infoLabel.text = message; infoLabel.visible = true; // Avoid dual message widgets notInstalledWarning.visible = false; } - onShowErrorMessage: { + function onShowErrorMessage(message) { infoLabel.type = Kirigami.MessageType.Error; infoLabel.text = message; infoLabel.visible = true; diff --git a/kcms/cursortheme/package/contents/ui/Delegate.qml b/kcms/cursortheme/package/contents/ui/Delegate.qml index 9581a53ed..7c0948d1b 100644 --- a/kcms/cursortheme/package/contents/ui/Delegate.qml +++ b/kcms/cursortheme/package/contents/ui/Delegate.qml @@ -55,7 +55,7 @@ KCM.GridDelegate { Connections { target: kcm - onThemeApplied: { + function onThemeApplied() { previewWidget.refresh(); } } diff --git a/kcms/cursortheme/package/contents/ui/main.qml b/kcms/cursortheme/package/contents/ui/main.qml index 9e3d4de88..88f071ed0 100644 --- a/kcms/cursortheme/package/contents/ui/main.qml +++ b/kcms/cursortheme/package/contents/ui/main.qml @@ -71,17 +71,17 @@ KCM.GridViewKCM { Connections { target: kcm - onShowSuccessMessage: { + function onShowSuccessMessage(message) { infoLabel.type = Kirigami.MessageType.Positive; infoLabel.text = message; infoLabel.visible = true; } - onShowInfoMessage: { + function onShowInfoMessage(message) { infoLabel.type = Kirigami.MessageType.Information; infoLabel.text = message; infoLabel.visible = true; } - onShowErrorMessage: { + function onShowErrorMessage(message) { infoLabel.type = Kirigami.MessageType.Error; infoLabel.text = message; infoLabel.visible = true; diff --git a/kcms/desktoptheme/package/contents/ui/main.qml b/kcms/desktoptheme/package/contents/ui/main.qml index 6e15bcf2f..64c67d4c7 100644 --- a/kcms/desktoptheme/package/contents/ui/main.qml +++ b/kcms/desktoptheme/package/contents/ui/main.qml @@ -158,12 +158,12 @@ KCM.GridViewKCM { Connections { target: kcm - onShowSuccessMessage: { + function onShowSuccessMessage(message) { infoLabel.type = Kirigami.MessageType.Positive; infoLabel.text = message; infoLabel.visible = true; } - onShowErrorMessage: { + function onShowErrorMessage(message) { infoLabel.type = Kirigami.MessageType.Error; infoLabel.text = message; infoLabel.visible = true; diff --git a/kcms/fonts/package/contents/ui/main.qml b/kcms/fonts/package/contents/ui/main.qml index 6086b0830..a63035bf4 100644 --- a/kcms/fonts/package/contents/ui/main.qml +++ b/kcms/fonts/package/contents/ui/main.qml @@ -50,7 +50,9 @@ KCM.SimpleKCM { Connections { target: kcm - onAliasingChangeApplied: antiAliasingMessage.visible = true + function onAliasingChangeApplied() { + antiAliasingMessage.visible = true + } } } @@ -62,7 +64,7 @@ KCM.SimpleKCM { Connections { target: kcm - onFontsHaveChanged: { + function onFontsHaveChanged() { hugeFontsMessage.visible = generalFontWidget.font.pointSize > 14 || fixedWidthFontWidget.font.pointSize > 14 || smallFontWidget.font.pointSize > 14 @@ -256,8 +258,12 @@ KCM.SimpleKCM { } Connections { target: kcm.fontsAASettings - onExcludeFromChanged: excludeFromSpinBox.value = kcm.fontsAASettings.excludeFrom; - onExcludeToChanged: excludeToSpinBox.value = kcm.fontsAASettings.excludeTo; + function onExcludeFromChanged() { + excludeFromSpinBox.value = kcm.fontsAASettings.excludeFrom; + } + function onExcludeToChanged() { + excludeToSpinBox.value = kcm.fontsAASettings.excludeTo; + } } } diff --git a/kcms/icons/package/contents/ui/IconSizePopup.qml b/kcms/icons/package/contents/ui/IconSizePopup.qml index 33ac1642d..b318f1c09 100644 --- a/kcms/icons/package/contents/ui/IconSizePopup.qml +++ b/kcms/icons/package/contents/ui/IconSizePopup.qml @@ -44,7 +44,7 @@ QtControls.Popup { Connections { target: iconTypeList - onCurrentIndexChanged: { + function onCurrentIndexChanged() { iconSizeSlider.sizes = kcm.availableIconSizes(iconTypeList.currentIndex); } } diff --git a/kcms/icons/package/contents/ui/main.qml b/kcms/icons/package/contents/ui/main.qml index ff42d4140..290faf037 100644 --- a/kcms/icons/package/contents/ui/main.qml +++ b/kcms/icons/package/contents/ui/main.qml @@ -187,12 +187,12 @@ KCM.GridViewKCM { Connections { target: kcm - onShowSuccessMessage: { + function onShowSuccessMessage(message) { infoLabel.type = Kirigami.MessageType.Positive; infoLabel.text = message; infoLabel.visible = true; } - onShowErrorMessage: { + function onShowErrorMessage(message) { infoLabel.type = Kirigami.MessageType.Error; infoLabel.text = message; infoLabel.visible = true; diff --git a/kcms/style/package/contents/ui/GtkStylePage.qml b/kcms/style/package/contents/ui/GtkStylePage.qml index db9381dd2..f15f2c578 100644 --- a/kcms/style/package/contents/ui/GtkStylePage.qml +++ b/kcms/style/package/contents/ui/GtkStylePage.qml @@ -43,7 +43,7 @@ Kirigami.Page { Connections { target: kcm.gtkPage - onShowErrorMessage: { + function onShowErrorMessage(message) { infoLabel.type = Kirigami.MessageType.Error; infoLabel.text = message; infoLabel.visible = true; @@ -73,7 +73,7 @@ Kirigami.Page { Connections { target: kcm.gtkPage - onSelectGtkThemeInCombobox: function(themeName) { + function onSelectGtkThemeInCombobox(themeName) { gtkThemeCombo.currentIndex = gtkThemeCombo.model.findThemeIndex(themeName) } } diff --git a/kcms/style/package/contents/ui/main.qml b/kcms/style/package/contents/ui/main.qml index ad8bf5c7b..ffec6738e 100644 --- a/kcms/style/package/contents/ui/main.qml +++ b/kcms/style/package/contents/ui/main.qml @@ -59,7 +59,7 @@ KCM.GridViewKCM { Connections { target: kcm - onShowErrorMessage: { + function onShowErrorMessage(message) { infoLabel.type = Kirigami.MessageType.Error; infoLabel.text = message; infoLabel.visible = true; @@ -96,7 +96,7 @@ KCM.GridViewKCM { Connections { target: kcm - onStyleReconfigured: { + function onStyleReconfigured(message) { if (styleName === model.styleName) { thumbnailItem.reload(); } diff --git a/kcms/translations/package/contents/ui/main.qml b/kcms/translations/package/contents/ui/main.qml index 1b8a111cb..2ecdce256 100644 --- a/kcms/translations/package/contents/ui/main.qml +++ b/kcms/translations/package/contents/ui/main.qml @@ -66,7 +66,9 @@ ScrollViewKCM { data: [Connections { target: addLanguagesSheet - onSheetOpenChanged: languageItem.checked = false + function onSheetOpenChanged() { + languageItem.checked = false + } }] } } diff --git a/lookandfeel/contents/desktopswitcher/DesktopSwitcher.qml b/lookandfeel/contents/desktopswitcher/DesktopSwitcher.qml index 54179e6b3..b55b0b6ad 100644 --- a/lookandfeel/contents/desktopswitcher/DesktopSwitcher.qml +++ b/lookandfeel/contents/desktopswitcher/DesktopSwitcher.qml @@ -153,7 +153,7 @@ KWin.Switcher { boundsBehavior: Flickable.StopAtBounds Connections { target: tabBox - onCurrentIndexChanged: {listView.currentIndex = tabBox.currentIndex;} + function onCurrentIndexChanged() {listView.currentIndex = tabBox.currentIndex;} } } Component { diff --git a/lookandfeel/contents/runcommand/RunCommand.qml b/lookandfeel/contents/runcommand/RunCommand.qml index bcdf58224..23886b090 100644 --- a/lookandfeel/contents/runcommand/RunCommand.qml +++ b/lookandfeel/contents/runcommand/RunCommand.qml @@ -40,7 +40,7 @@ ColumnLayout { Connections { target: runnerWindow - onVisibleChanged: { + function onVisibleChanged() { if (runnerWindow.visible) { queryField.forceActiveFocus(); listView.currentIndex = -1 diff --git a/lookandfeel/contents/windowswitcher/WindowSwitcher.qml b/lookandfeel/contents/windowswitcher/WindowSwitcher.qml index 7eedb439f..245b46c69 100644 --- a/lookandfeel/contents/windowswitcher/WindowSwitcher.qml +++ b/lookandfeel/contents/windowswitcher/WindowSwitcher.qml @@ -61,7 +61,7 @@ KWin.Switcher { Connections { target: tabBox - onCurrentIndexChanged: { + function onCurrentIndexChanged() { thumbnailListView.currentIndex = tabBox.currentIndex; thumbnailListView.positionViewAtIndex(thumbnailListView.currentIndex, ListView.Contain) } diff --git a/wallpapers/image/imagepackage/contents/ui/config.qml b/wallpapers/image/imagepackage/contents/ui/config.qml index f8858cfdb..8b19b017d 100644 --- a/wallpapers/image/imagepackage/contents/ui/config.qml +++ b/wallpapers/image/imagepackage/contents/ui/config.qml @@ -198,9 +198,9 @@ ColumnLayout { ColumnLayout { Connections { target: root - onHoursIntervalValueChanged: hoursInterval.value = root.hoursIntervalValue - onMinutesIntervalValueChanged: minutesInterval.value = root.minutesIntervalValue - onSecondsIntervalValueChanged: secondsInterval.value = root.secondsIntervalValue + function onHoursIntervalValueChanged() {hoursInterval.value = root.hoursIntervalValue} + function onMinutesIntervalValueChanged() {minutesInterval.value = root.minutesIntervalValue} + function onSecondsIntervalValueChanged() {secondsInterval.value = root.secondsIntervalValue} } //FIXME: there should be only one spinbox: QtControls spinboxes are still too limited for it tough Kirigami.FormLayout { diff --git a/wallpapers/image/imagepackage/platformcontents/phone/ui/config.qml b/wallpapers/image/imagepackage/platformcontents/phone/ui/config.qml index bea70980c..8afa7e46b 100644 --- a/wallpapers/image/imagepackage/platformcontents/phone/ui/config.qml +++ b/wallpapers/image/imagepackage/platformcontents/phone/ui/config.qml @@ -66,7 +66,9 @@ Item { Connections { target: imageWallpaper - onCustomWallpaperPicked: wallpapersGrid.currentIndex = 0 + function onCustomWallpaperPicked() { + wallpapersGrid.currentIndex = 0 + } } } } diff --git a/wallpapers/image/imagepackage/platformcontents/touch/ui/config.qml b/wallpapers/image/imagepackage/platformcontents/touch/ui/config.qml index 33c84f3ac..1b4d0534e 100644 --- a/wallpapers/image/imagepackage/platformcontents/touch/ui/config.qml +++ b/wallpapers/image/imagepackage/platformcontents/touch/ui/config.qml @@ -71,7 +71,9 @@ Item { Connections { target: imageWallpaper - onCustomWallpaperPicked: wallpapersGrid.currentIndex = 0 + function onCustomWallpaperPicked() { + wallpapersGrid.currentIndex = 0 + } } } }