Commit cca20ea4 authored by Nate Graham's avatar Nate Graham
Browse files

applets/keyboardlayout: fix unqualified property access

Whenever we access a property in an item higher up the stack, we need to
refer to it explicitly.
parent 4d666252
Pipeline #217323 canceled with stage
in 3 minutes and 8 seconds
......@@ -7,6 +7,8 @@ import org.kde.kquickcontrolsaddons 2.0 as KQCAddons
import org.kde.plasma.workspace.keyboardlayout 1.0
Kirigami.FormLayout {
id: root
property alias cfg_showFlag: showFlag.checked
readonly property var layoutShortName: keyboardLayout.layoutsList.length ? keyboardLayout.layoutsList[keyboardLayout.layout].shortName
: ""
......@@ -16,7 +18,7 @@ Kirigami.FormLayout {
id: showLabel
Kirigami.FormData.label: i18n("Display style:")
checked: true
text: layoutShortName.toUpperCase()
text: root.layoutShortName.toUpperCase()
}
RadioButton {
......@@ -30,7 +32,7 @@ Kirigami.FormLayout {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
source: Platform.StandardPaths.locate(Platform.StandardPaths.GenericDataLocation,
"kf5/locale/countries/" + layoutShortName + "/flag.png")
"kf5/locale/countries/" + root.layoutShortName + "/flag.png")
}
}
}
......
  • Just a note: is there a particular problem we are solving here, or it's just good way to do things?

  • In Qt6, this is required, so it's a forwards-compatibility thing.

  • More strict and less dynamic code is always a good thing.

Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment