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
Utilities
Kate
Commits
cbf31332
Commit
cbf31332
authored
Aug 09, 2022
by
Pablo Rauzy
Committed by
Christoph Cullmann
Aug 14, 2022
Browse files
consistently use operator[] rather than .at()
parent
d6e64f52
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/keyboardmacros/keyboardmacrosplugin.cpp
View file @
cbf31332
...
...
@@ -721,7 +721,7 @@ KeyboardMacrosPluginCommands::KeyboardMacrosPluginCommands(KeyboardMacrosPlugin
bool
KeyboardMacrosPluginCommands
::
exec
(
KTextEditor
::
View
*
view
,
const
QString
&
cmd
,
QString
&
msg
,
const
KTextEditor
::
Range
&
)
{
const
QStringList
&
actionAndName
=
cmd
.
split
(
QRegularExpression
(
QStringLiteral
(
"
\\
s+"
)));
const
QString
&
action
=
actionAndName
.
at
(
0
)
;
const
QString
&
action
=
actionAndName
[
0
]
;
// kmplay can take either zero or one argument, all other commands require exactly one
if
(
actionAndName
.
length
()
>
2
||
(
action
!=
QStringLiteral
(
"kmplay"
)
&&
actionAndName
.
length
()
!=
2
))
{
msg
=
i18n
(
"Usage: %1 <name>."
,
action
);
...
...
@@ -736,7 +736,7 @@ bool KeyboardMacrosPluginCommands::exec(KTextEditor::View *view, const QString &
return
true
;
}
else
{
// otherwise play the given macro
const
QString
&
name
=
actionAndName
.
at
(
1
)
;
const
QString
&
name
=
actionAndName
[
1
]
;
if
(
!
m_plugin
->
play
(
name
))
{
msg
=
i18n
(
"No keyboard macro named '%1' found."
,
name
);
return
false
;
...
...
@@ -744,7 +744,7 @@ bool KeyboardMacrosPluginCommands::exec(KTextEditor::View *view, const QString &
return
true
;
}
}
const
QString
&
name
=
actionAndName
.
at
(
1
)
;
const
QString
&
name
=
actionAndName
[
1
]
;
if
(
action
==
QStringLiteral
(
"kmsave"
))
{
if
(
!
m_plugin
->
save
(
name
))
{
msg
=
i18n
(
"Cannot save empty keyboard macro."
);
...
...
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