KeyboardLayout: always set componentDisplayName for shortcut
Otherwise the last call uses the default, which overrides the previous calls. Test plan: - Go to system settings - shortcuts - Verify the category for layout switching is now correctly called "Keyboard Layout Switcher" CCBUG: 492019
This commit is contained in:
parent
eaf7e9a3a2
commit
af8de6be74
1 changed files with 2 additions and 0 deletions
|
@ -134,6 +134,7 @@ void KeyboardLayout::loadShortcuts()
|
||||||
qDeleteAll(m_layoutShortcuts);
|
qDeleteAll(m_layoutShortcuts);
|
||||||
m_layoutShortcuts.clear();
|
m_layoutShortcuts.clear();
|
||||||
const QString componentName = QStringLiteral("KDE Keyboard Layout Switcher");
|
const QString componentName = QStringLiteral("KDE Keyboard Layout Switcher");
|
||||||
|
const QString componentDisplayName = i18n("Keyboard Layout Switcher");
|
||||||
const quint32 count = m_xkb->numberOfLayouts();
|
const quint32 count = m_xkb->numberOfLayouts();
|
||||||
for (uint i = 0; i < count; ++i) {
|
for (uint i = 0; i < count; ++i) {
|
||||||
// layout name is translated in the action name in keyboard kcm!
|
// layout name is translated in the action name in keyboard kcm!
|
||||||
|
@ -145,6 +146,7 @@ void KeyboardLayout::loadShortcuts()
|
||||||
QAction *a = new QAction(this);
|
QAction *a = new QAction(this);
|
||||||
a->setObjectName(action);
|
a->setObjectName(action);
|
||||||
a->setProperty("componentName", componentName);
|
a->setProperty("componentName", componentName);
|
||||||
|
a->setProperty("componentDisplayName", componentDisplayName);
|
||||||
connect(a, &QAction::triggered, this,
|
connect(a, &QAction::triggered, this,
|
||||||
std::bind(&KeyboardLayout::switchToLayout, this, i));
|
std::bind(&KeyboardLayout::switchToLayout, this, i));
|
||||||
KGlobalAccel::self()->setShortcut(a, shortcuts, KGlobalAccel::Autoloading);
|
KGlobalAccel::self()->setShortcut(a, shortcuts, KGlobalAccel::Autoloading);
|
||||||
|
|
Loading…
Reference in a new issue