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
af7d5cd4
Commit
af7d5cd4
authored
Aug 27, 2022
by
Christoph Cullmann
🍨
Browse files
avoid QPair, try to fix FreeBSD Qt6 compile
parent
d4bb7dc7
Pipeline
#223275
failed with stage
in 3 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
addons/keyboardmacros/keycombination.h
View file @
af7d5cd4
...
...
@@ -6,6 +6,8 @@
#ifndef KEYBOARDMACROSPLUGIN_KEYCOMBINATION_H
#define KEYBOARDMACROSPLUGIN_KEYCOMBINATION_H
#include
<utility>
#include
<QDebug>
#include
<QJsonArray>
#include
<QJsonValue>
...
...
@@ -34,12 +36,12 @@ public:
,
m_modifiers
(
keyEvent
->
modifiers
())
,
m_text
(
keyEvent
->
text
()){};
static
const
QP
air
<
const
KeyCombination
,
bool
>
fromJson
(
const
QJsonArray
&
json
)
static
const
std
::
p
air
<
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
QP
air
(
KeyCombination
(),
false
);
return
std
::
p
air
(
KeyCombination
(),
false
);
}
return
QP
air
(
KeyCombination
(
json
[
0
].
toInt
(
0
),
static_cast
<
Qt
::
KeyboardModifiers
>
(
json
[
1
].
toInt
(
0
)),
json
[
2
].
toString
()),
true
);
return
std
::
p
air
(
KeyCombination
(
json
[
0
].
toInt
(
0
),
static_cast
<
Qt
::
KeyboardModifiers
>
(
json
[
1
].
toInt
(
0
)),
json
[
2
].
toString
()),
true
);
};
const
QKeyEvent
keyPress
()
const
...
...
addons/keyboardmacros/macro.h
View file @
af7d5cd4
...
...
@@ -6,6 +6,8 @@
#ifndef KEYBOARDMACROSPLUGIN_MACRO_H
#define KEYBOARDMACROSPLUGIN_MACRO_H
#include
<utility>
#include
<QDebug>
#include
<QJsonArray>
#include
<QJsonValue>
...
...
@@ -21,23 +23,23 @@ public:
explicit
Macro
()
:
QList
<
KeyCombination
>
(){};
static
const
QP
air
<
const
Macro
,
bool
>
fromJson
(
const
QJsonValue
&
json
)
static
const
std
::
p
air
<
const
Macro
,
bool
>
fromJson
(
const
QJsonValue
&
json
)
{
if
(
json
.
type
()
!=
QJsonValue
::
Array
)
{
QP
air
(
Macro
(),
false
);
std
::
p
air
(
Macro
(),
false
);
}
Macro
macro
;
for
(
const
auto
&
jsonKeyCombination
:
json
.
toArray
())
{
if
(
jsonKeyCombination
.
type
()
!=
QJsonValue
::
Array
)
{
return
QP
air
(
Macro
(),
false
);
return
std
::
p
air
(
Macro
(),
false
);
}
auto
maybeKeyCombination
=
KeyCombination
::
fromJson
(
jsonKeyCombination
.
toArray
());
if
(
!
maybeKeyCombination
.
second
)
{
return
QP
air
(
Macro
(),
false
);
return
std
::
p
air
(
Macro
(),
false
);
}
macro
.
append
(
maybeKeyCombination
.
first
);
}
return
QP
air
(
macro
,
true
);
return
std
::
p
air
(
macro
,
true
);
};
const
QJsonArray
toJson
()
const
...
...
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