Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Desktop
Commits
27dc2efd
Commit
27dc2efd
authored
Mar 15, 2022
by
Laurent Montel
Browse files
Port I18n_NOOP
parent
698215ef
Pipeline
#150453
passed with stage
in 3 minutes and 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kcms/keyboard/bindings.cpp
View file @
27dc2efd
...
...
@@ -17,16 +17,13 @@
#include
"flags.h"
#include
"x11_helper.h"
static
const
char
actionName
[]
=
I18N_NOOP
(
"Switch to Next Keyboard Layout"
);
static
const
char
COMPONENT_NAME
[]
=
I18N_NOOP
(
"KDE Keyboard Layout Switcher"
);
KeyboardLayoutActionCollection
::
KeyboardLayoutActionCollection
(
QObject
*
parent
,
bool
configAction_
)
:
KActionCollection
(
parent
,
COMPONENT_NAME
)
:
KActionCollection
(
parent
,
QStringLiteral
(
"KDE Keyboard Layout Switcher"
)
)
,
configAction
(
configAction_
)
{
setComponentDisplayName
(
i18n
(
"Keyboard Layout Switcher"
));
QAction
*
toggleAction
=
addAction
(
actionName
);
toggleAction
->
setText
(
i18n
(
actionName
));
QAction
*
toggleAction
=
addAction
(
QStringLiteral
(
"Switch to Next Keyboard Layout"
)
);
toggleAction
->
setText
(
i18n
(
"Switch to Next Keyboard Layout"
));
KGlobalAccel
::
self
()
->
setShortcut
(
toggleAction
,
QList
<
QKeySequence
>
()
<<
QKeySequence
(
Qt
::
ALT
+
Qt
::
CTRL
+
Qt
::
Key_K
),
KGlobalAccel
::
Autoloading
);
if
(
configAction
)
{
toggleAction
->
setProperty
(
"isConfigurationAction"
,
true
);
...
...
@@ -76,7 +73,7 @@ void KeyboardLayoutActionCollection::setLayoutShortcuts(QList<LayoutUnit> &layou
createLayoutShortcutActon
(
layoutUnit
,
i
,
rules
,
false
);
}
}
qCDebug
(
KCM_KEYBOARD
)
<<
"Cleaning component shortcuts on save"
<<
KGlobalAccel
::
cleanComponent
(
COMPONENT_NAME
);
qCDebug
(
KCM_KEYBOARD
)
<<
"Cleaning component shortcuts on save"
<<
KGlobalAccel
::
cleanComponent
(
QStringLiteral
(
"KDE Keyboard Layout Switcher"
)
);
}
void
KeyboardLayoutActionCollection
::
loadLayoutShortcuts
(
QList
<
LayoutUnit
>
&
layoutUnits
,
const
Rules
*
rules
)
...
...
@@ -93,7 +90,7 @@ void KeyboardLayoutActionCollection::loadLayoutShortcuts(QList<LayoutUnit> &layo
removeAction
(
action
);
}
}
qCDebug
(
KCM_KEYBOARD
)
<<
"Cleaning component shortcuts on load"
<<
KGlobalAccel
::
cleanComponent
(
COMPONENT_NAME
);
qCDebug
(
KCM_KEYBOARD
)
<<
"Cleaning component shortcuts on load"
<<
KGlobalAccel
::
cleanComponent
(
QStringLiteral
(
"KDE Keyboard Layout Switcher"
)
);
}
void
KeyboardLayoutActionCollection
::
resetLayoutShortcuts
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment