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
PIM
Akonadi
Commits
6bc280c2
Commit
6bc280c2
authored
Dec 29, 2021
by
Laurent Montel
Browse files
Fix some qt6 compile error
parent
798401bb
Pipeline
#115817
passed with stage
in 5 minutes and 8 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/private/protocolgen/cppgenerator.cpp
View file @
6bc280c2
...
...
@@ -443,7 +443,13 @@ void CppGenerator::writeImplSerializer(PropertyNode const *node, const char *str
--
it
;
const
QString
mVar
=
it
.
key
();
mImpl
<<
"(obj."
<<
"m"
<<
mVar
[
0
].
toUpper
()
<<
mVar
.
midRef
(
1
)
<<
" & "
<<
it
.
value
()
<<
")"
;
<<
"m"
<<
mVar
[
0
].
toUpper
()
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
<<
mVar
.
midRef
(
1
)
#else
<<
QStringView
(
mVar
).
mid
(
1
)
#endif
<<
" & "
<<
it
.
value
()
<<
")"
;
if
(
it
==
deps
.
cbegin
())
{
break
;
}
else
{
...
...
@@ -536,10 +542,21 @@ void CppGenerator::writeImplClass(ClassNode const *node)
<<
" &val)
\n
"
"{
\n
"
;
if
(
!
setter
->
append
.
isEmpty
())
{
mImpl
<<
" m"
<<
setter
->
append
[
0
].
toUpper
()
<<
setter
->
append
.
midRef
(
1
)
<<
" << val;
\n
"
;
mImpl
<<
" m"
<<
setter
->
append
[
0
].
toUpper
()
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
<<
setter
->
append
.
midRef
(
1
)
#else
<<
QStringView
(
setter
->
append
).
mid
(
1
)
#endif
<<
" << val;
\n
"
;
}
if
(
!
setter
->
remove
.
isEmpty
())
{
const
QString
mVar
=
QLatin1String
(
"m"
)
+
setter
->
remove
[
0
].
toUpper
()
+
setter
->
remove
.
midRef
(
1
);
const
QString
mVar
=
QLatin1String
(
"m"
)
+
setter
->
remove
[
0
].
toUpper
()
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+
setter
->
remove
.
midRef
(
1
);
#else
+
QStringView
(
setter
->
remove
).
mid
(
1
);
#endif
mImpl
<<
" auto it = std::find("
<<
mVar
<<
".begin(), "
<<
mVar
<<
".end(), val);
\n
"
" if (it != "
...
...
src/private/protocolgen/nodetree.cpp
View file @
6bc280c2
...
...
@@ -106,7 +106,11 @@ QString ClassNode::parentClassName() const
Q_UNREACHABLE
();
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
ClassNode
::
ClassType
ClassNode
::
elementNameToType
(
const
QStringRef
&
name
)
#else
ClassNode
::
ClassType
ClassNode
::
elementNameToType
(
QStringView
name
)
#endif
{
if
(
name
==
QLatin1String
(
"class"
))
{
return
Class
;
...
...
@@ -174,8 +178,11 @@ EnumNode::EnumType EnumNode::enumType() const
{
return
mEnumType
;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
EnumNode
::
EnumType
EnumNode
::
elementNameToType
(
const
QStringRef
&
name
)
#else
EnumNode
::
EnumType
EnumNode
::
elementNameToType
(
QStringView
name
)
#endif
{
if
(
name
==
QLatin1String
(
"enum"
))
{
return
TypeEnum
;
...
...
src/private/protocolgen/nodetree.h
View file @
6bc280c2
...
...
@@ -72,7 +72,11 @@ public:
QString
parentClassName
()
const
;
QVector
<
PropertyNode
const
*>
properties
()
const
;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
static
ClassType
elementNameToType
(
const
QStringRef
&
name
);
#else
static
ClassType
elementNameToType
(
QStringView
name
);
#endif
private:
QString
mName
;
...
...
@@ -117,9 +121,11 @@ public:
QString
name
()
const
;
EnumType
enumType
()
const
;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
static
EnumType
elementNameToType
(
const
QStringRef
&
name
);
#else
static
EnumType
elementNameToType
(
QStringView
name
);
#endif
private:
QString
mName
;
EnumType
mEnumType
;
...
...
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