Commit f60dcd7b authored by Andrey Butirsky's avatar Andrey Butirsky
Browse files

[keyboard applet] fix TypeError garbage in log

While unharmful (JS checks array bounds), these errors pollute log every
time the applet starts:

file:///usr/share/plasma/plasmoids/org.kde.plasma.keyboardlayout/
contents/ui/main.qml:16: TypeError: Cannot read property 'displayName'
of undefined
file:///usr/share/plasma/plasmoids/org.kde.plasma.keyboardlayout/
contents/ui/main.qml:17: TypeError: Cannot read property 'longName' of
undefined
file:///usr/share/plasma/plasmoids/org.kde.plasma.keyboardlayout/
contents/ui/main.qml:18: TypeError: Cannot read property 'shortName' of
undefined

CCBUG: 432029
parent eab3f6c5
......@@ -11,7 +11,7 @@ import org.kde.plasma.workspace.keyboardlayout 1.0
PlasmaComponents3.ToolButton {
property alias keyboardLayout: keyboardLayout
readonly property bool hasMultipleKeyboardLayouts: keyboardLayout.layoutsList.length > 1
readonly property var layoutNames: keyboardLayout.layoutsList[keyboardLayout.layout]
readonly property var layoutNames: keyboardLayout.layoutsList.length ? keyboardLayout.layoutsList[keyboardLayout.layout] : ""
text: layoutNames.longName
visible: hasMultipleKeyboardLayouts
......
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