Skip to content
GitLab
Menu
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
6eb0976e
Commit
6eb0976e
authored
Jun 04, 2021
by
Laurent Montel
😁
Browse files
USe QStringView here
parent
37b955fc
Pipeline
#64181
passed with stage
in 10 minutes and 52 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/private/protocolgen/cppgenerator.cpp
View file @
6eb0976e
...
...
@@ -801,7 +801,13 @@ void CppGenerator::writeImplPropertyDependencies(const PropertyNode *node)
}
}
if
(
!
values
.
isEmpty
())
{
mImpl
<<
" m"
<<
key
[
0
].
toUpper
()
<<
key
.
midRef
(
1
)
<<
" |= "
<<
enumType
<<
"("
<<
values
.
join
(
QLatin1String
(
" | "
))
<<
");
\n
"
;
mImpl
<<
" m"
<<
key
[
0
].
toUpper
()
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)
<<
QStringView
(
key
).
mid
(
1
)
#else
<<
key
.
midRef
(
1
)
#endif
<<
" |= "
<<
enumType
<<
"("
<<
values
.
join
(
QLatin1String
(
" | "
))
<<
");
\n
"
;
values
.
clear
();
}
}
...
...
@@ -809,7 +815,13 @@ void CppGenerator::writeImplPropertyDependencies(const PropertyNode *node)
}
if
(
!
values
.
isEmpty
())
{
mImpl
<<
" m"
<<
key
[
0
].
toUpper
()
<<
key
.
midRef
(
1
)
<<
" |= "
<<
enumType
<<
"("
<<
values
.
join
(
QLatin1String
(
" | "
))
<<
");
\n
"
;
mImpl
<<
" m"
<<
key
[
0
].
toUpper
()
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)
<<
QStringView
(
key
).
mid
(
1
)
#else
<<
key
.
midRef
(
1
)
#endif
<<
" |= "
<<
enumType
<<
"("
<<
values
.
join
(
QLatin1String
(
" | "
))
<<
");
\n
"
;
}
}
...
...
src/private/protocolgen/nodetree.cpp
View file @
6eb0976e
...
...
@@ -290,10 +290,20 @@ PropertyNode::Setter *PropertyNode::setter() const
QString
PropertyNode
::
mVariableName
()
const
{
return
QStringLiteral
(
"m"
)
+
mName
[
0
].
toUpper
()
+
mName
.
midRef
(
1
);
return
QStringLiteral
(
"m"
)
+
mName
[
0
].
toUpper
()
+
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)
QStringView
(
mName
).
mid
(
1
);
#else
mName
.
midRef
(
1
);
#endif
}
QString
PropertyNode
::
setterName
()
const
{
return
QStringLiteral
(
"set"
)
+
mName
[
0
].
toUpper
()
+
mName
.
midRef
(
1
);
return
QStringLiteral
(
"set"
)
+
mName
[
0
].
toUpper
()
+
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)
QStringView
(
mName
).
mid
(
1
);
#else
mName
.
midRef
(
1
);
#endif
}
src/private/protocolgen/nodetree.h
View file @
6eb0976e
...
...
@@ -89,7 +89,12 @@ public:
QString
mVariableName
()
const
{
return
QStringLiteral
(
"m"
)
+
name
[
0
].
toUpper
()
+
name
.
midRef
(
1
);
return
QStringLiteral
(
"m"
)
+
name
[
0
].
toUpper
()
+
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)
QStringView
(
name
).
mid
(
1
);
#else
name
.
midRef
(
1
);
#endif
}
};
...
...
src/server/storage/dbconfigpostgresql.cpp
View file @
6eb0976e
...
...
@@ -77,11 +77,19 @@ private:
return
{};
}
bool
ok
=
false
;
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)
const
auto
major
=
QStringView
(
name
).
left
(
dotIdx
).
toInt
(
&
ok
);
#else
const
auto
major
=
name
.
leftRef
(
dotIdx
).
toInt
(
&
ok
);
#endif
if
(
!
ok
)
{
return
{};
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)
const
auto
minor
=
QStringView
(
name
).
mid
(
dotIdx
+
1
).
toInt
(
&
ok
);
#else
const
auto
minor
=
name
.
midRef
(
dotIdx
+
1
).
toInt
(
&
ok
);
#endif
if
(
!
ok
)
{
return
{};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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