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
e7f829b1
Commit
e7f829b1
authored
Aug 09, 2022
by
Pablo Rauzy
Committed by
Christoph Cullmann
Aug 14, 2022
Browse files
adding const qualifier where possible
parent
d01808c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/keyboardmacros/keycombination.h
View file @
e7f829b1
...
...
@@ -24,7 +24,7 @@ private:
public:
KeyCombination
(){};
KeyCombination
(
int
key
,
Qt
::
KeyboardModifiers
modifiers
,
QString
text
)
KeyCombination
(
const
int
key
,
const
Qt
::
KeyboardModifiers
modifiers
,
const
QString
text
)
:
m_key
(
key
)
,
m_modifiers
(
modifiers
)
,
m_text
(
text
){};
...
...
@@ -34,7 +34,7 @@ public:
,
m_modifiers
(
keyEvent
->
modifiers
())
,
m_text
(
keyEvent
->
text
()){};
static
const
QPair
<
KeyCombination
,
bool
>
fromJson
(
const
QJsonArray
&
json
)
static
const
QPair
<
const
KeyCombination
,
bool
>
fromJson
(
const
QJsonArray
&
json
)
{
if
(
json
.
size
()
!=
3
||
json
[
0
].
type
()
!=
QJsonValue
::
Double
||
json
[
1
].
type
()
!=
QJsonValue
::
Double
||
json
[
2
].
type
()
!=
QJsonValue
::
String
)
{
return
QPair
(
KeyCombination
(),
false
);
...
...
@@ -72,7 +72,7 @@ public:
bool
isVisibleInput
()
const
{
return
m_text
.
size
()
==
1
&&
(
m_modifiers
==
Qt
::
NoModifier
||
m_modifiers
==
Qt
::
ShiftModifier
)
&&
m_text
[
0
].
isPrint
();
}
}
;
friend
QDebug
operator
<<
(
QDebug
dbg
,
const
KeyCombination
&
kc
)
{
...
...
addons/keyboardmacros/macro.h
View file @
e7f829b1
...
...
@@ -21,7 +21,7 @@ public:
explicit
Macro
()
:
QList
<
KeyCombination
>
(){};
static
const
QPair
<
Macro
,
bool
>
fromJson
(
const
QJsonValue
&
json
)
static
const
QPair
<
const
Macro
,
bool
>
fromJson
(
const
QJsonValue
&
json
)
{
if
(
json
.
type
()
!=
QJsonValue
::
Array
)
{
QPair
(
Macro
(),
false
);
...
...
@@ -40,7 +40,7 @@ public:
return
QPair
(
macro
,
true
);
};
QJsonArray
toJson
()
const
const
QJsonArray
toJson
()
const
{
QJsonArray
json
;
Macro
::
ConstIterator
it
;
...
...
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