When adding a custom shortcut Meta+Shift+7 using System Settings
Instead of "Meta+&", "Meta+" is displayed under the "Custom shortcuts" label.
However, beside the name of the shortcut, "Meta+&" is correctly displayed.
STEPS TO REPRODUCE
1. Open "Shortcuts"
2. Add "Meta+Shift+7" as a shortcut to something (using the custom shortcuts feature)
"Meta+" shown under "Custom shortcuts"
"Meta+&" shown under "Custom shortcuts"
Linux/KDE Plasma: KDE neon 5.21 (User) on Linux 5.4.0-73-generic
KDE Plasma Version: 5.21.5 (X11)
KDE Frameworks Version: 5.82.0
Qt Version: 5.12.2
Maybe this is because the ampersand isn't correctly escaped? (I think & is used for Qt stuff?)
Yeah, looks like it's not correctly escaped.
I was just wondering, since I think the keyboard shortcut widget is used in many places, the fix would be on the widget, not the System Settings app?
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kdeclarative/-/merge_requests/61
(In reply to Colour Delete from comment #2)
> I was just wondering, since I think the keyboard shortcut widget is used in
> many places, the fix would be on the widget, not the System Settings app?
Understood; thank you!
Git commit ca86b73f754947b1a2c1a0223c81634480c3a3f1 by Nate Graham.
Committed on 27/05/2021 at 22:59.
Pushed by ngraham into branch 'master'.
[KeySequenceItem] Display ampersands in shortcuts
We have to replace the single ampersand that we get back from
QKeySequence::toString() to be two ampersands, because the QQC2 Button
that will display this string interprets a single ampersand as a
mnemonic and hides it, which is not correct for our use of it here.
M +6 -1 src/qmlcontrols/kquickcontrols/KeySequenceItem.qml