Commit be7a548f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to QStringView when we build against qt6

parent d05f5227
Pipeline #128580 passed with stage
in 43 seconds
......@@ -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)
......
......@@ -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);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment