From d84198f3b85f0ecb9d37fd9452f98913baac7c66 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Mon, 26 Jul 2021 10:37:48 +0200 Subject: [PATCH] Set component display name for touchpad and keyboard shortcuts Otherwise they appear as "KWin" in the settings when we want them to be "Touchpad" and "Keyboard Layout Switcher". BUG:440259 FIXED-IN:5.23 --- src/input.cpp | 6 ++++++ src/keyboard_layout.cpp | 1 + 2 files changed, 7 insertions(+) diff --git a/src/input.cpp b/src/input.cpp index 14bf7e6320..2df41567f4 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -39,6 +39,7 @@ #include "cursor.h" #include #include +#include #include #include #include @@ -2480,12 +2481,17 @@ void InputRedirection::setupTouchpadShortcuts() QAction *touchpadOnAction = new QAction(this); QAction *touchpadOffAction = new QAction(this); + const QString touchpadDisplayName = i18n("Touchpad"); + touchpadToggleAction->setObjectName(QStringLiteral("Toggle Touchpad")); touchpadToggleAction->setProperty("componentName", s_touchpadComponent); + touchpadToggleAction->setProperty("componentDisplayName", touchpadDisplayName); touchpadOnAction->setObjectName(QStringLiteral("Enable Touchpad")); touchpadOnAction->setProperty("componentName", s_touchpadComponent); + touchpadOnAction->setProperty("componentDisplayName", touchpadDisplayName); touchpadOffAction->setObjectName(QStringLiteral("Disable Touchpad")); touchpadOffAction->setProperty("componentName", s_touchpadComponent); + touchpadOffAction->setProperty("componentDisplayName", touchpadDisplayName); KGlobalAccel::self()->setDefaultShortcut(touchpadToggleAction, QList{Qt::Key_TouchpadToggle}); KGlobalAccel::self()->setShortcut(touchpadToggleAction, QList{Qt::Key_TouchpadToggle}); KGlobalAccel::self()->setDefaultShortcut(touchpadOnAction, QList{Qt::Key_TouchpadOn}); diff --git a/src/keyboard_layout.cpp b/src/keyboard_layout.cpp index d2508fe3cf..3bd129c3f0 100644 --- a/src/keyboard_layout.cpp +++ b/src/keyboard_layout.cpp @@ -43,6 +43,7 @@ void KeyboardLayout::init() QAction *switchKeyboardAction = new QAction(this); switchKeyboardAction->setObjectName(QStringLiteral("Switch to Next Keyboard Layout")); switchKeyboardAction->setProperty("componentName", QStringLiteral("KDE Keyboard Layout Switcher")); + switchKeyboardAction->setProperty("componentDisplayName", i18n("Keyboard Layout Switcher")); const QKeySequence sequence = QKeySequence(Qt::ALT+Qt::CTRL+Qt::Key_K); KGlobalAccel::self()->setDefaultShortcut(switchKeyboardAction, QList({sequence})); KGlobalAccel::self()->setShortcut(switchKeyboardAction, QList({sequence}));