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(<arguments>) { ... }
This commit is contained in:
Konrad Materka 2020-11-11 17:44:38 +01:00
parent 7cab8cf8bb
commit d2f3372749
10 changed files with 31 additions and 15 deletions

View file

@ -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
}
}
}

View file

@ -121,7 +121,9 @@ Kirigami.Page {
Connections {
target: kcm
onThemeChanged: borderSizeComboBox.autoBorderUpdate()
function onThemeChanged() {
borderSizeComboBox.autoBorderUpdate()
}
}
}
Item {

View file

@ -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;
}
}

View file

@ -35,7 +35,7 @@ Multimedia.Video {
}
Connections {
target: videoItem
onStopped: {
function onStopped() {
replayButton.visible = true
}
}

View file

@ -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();
}
}
}

View file

@ -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();
}
}
}

View file

@ -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)

View file

@ -17,7 +17,7 @@ Item {
Connections {
target: workspace
onCurrentDesktopChanged: {
function onCurrentDesktopChanged() {
if (!mainItemLoader.item) {
mainItemLoader.source = "osd.qml";
}

View file

@ -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;

View file

@ -67,7 +67,7 @@ ColumnLayout {
Connections {
target: org_kde_kwin_tests_pointerconstraints_backend
onForceSurfaceCommit: {
function onForceSurfaceCommit() {
forceCommitRect.visible = true
}
}