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
Games
Kapman
Commits
be7a548f
Commit
be7a548f
authored
Jan 25, 2022
by
Laurent Montel
Browse files
Port to QStringView when we build against qt6
parent
d05f5227
Pipeline
#128580
passed with stage
in 43 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kapmanparser.cpp
View file @
be7a548f
...
...
@@ -54,14 +54,20 @@ bool KapmanParser::parse(QIODevice *input)
return
true
;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
bool
KapmanParser
::
characters
(
const
QStringRef
&
ch
)
#else
bool
KapmanParser
::
characters
(
const
QStringView
&
ch
)
#endif
{
m_buffer
=
ch
.
toString
();
return
true
;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
bool
KapmanParser
::
startElement
(
const
QStringRef
&
namespaceURI
,
const
QStringRef
&
localName
,
const
QStringRef
&
qName
,
const
QXmlStreamAttributes
&
atts
)
#else
bool
KapmanParser
::
startElement
(
const
QStringView
&
namespaceURI
,
const
QStringView
&
localName
,
const
QStringView
&
qName
,
const
QXmlStreamAttributes
&
atts
)
#endif
{
Q_UNUSED
(
namespaceURI
)
Q_UNUSED
(
localName
)
...
...
@@ -145,8 +151,11 @@ bool KapmanParser::startElement(const QStringRef &namespaceURI, const QStringRef
return
true
;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
bool
KapmanParser
::
endElement
(
const
QStringRef
&
namespaceURI
,
const
QStringRef
&
localName
,
const
QStringRef
&
qName
)
#else
bool
KapmanParser
::
endElement
(
const
QStringView
&
namespaceURI
,
const
QStringView
&
localName
,
const
QStringView
&
qName
)
#endif
{
Q_UNUSED
(
namespaceURI
)
Q_UNUSED
(
localName
)
...
...
src/kapmanparser.h
View file @
be7a548f
...
...
@@ -38,13 +38,19 @@ public:
* Deletes the GameParser instance.
*/
~
KapmanParser
();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
bool
characters
(
const
QStringRef
&
ch
);
bool
startElement
(
const
QStringRef
&
namespaceURI
,
const
QStringRef
&
localName
,
const
QStringRef
&
qName
,
const
QXmlStreamAttributes
&
atts
);
bool
endElement
(
const
QStringRef
&
namespaceURI
,
const
QStringRef
&
localName
,
const
QStringRef
&
qName
);
#else
bool
characters
(
const
QStringView
&
ch
);
bool
startElement
(
const
QStringView
&
namespaceURI
,
const
QStringView
&
localName
,
const
QStringView
&
qName
,
const
QXmlStreamAttributes
&
atts
);
bool
endElement
(
const
QStringView
&
namespaceURI
,
const
QStringView
&
localName
,
const
QStringView
&
qName
);
#endif
bool
parse
(
QIODevice
*
input
);
};
...
...
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