summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimeprovider.cpp
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2020-08-12 11:58:54 +0200
committerKarsten Heimrich <karsten.heimrich@qt.io>2020-08-19 19:48:03 +0200
commita8028a02df32355f4df4c036dbb82e9f8e8d527f (patch)
treeca5ae77f5de57a7828a526d85e702e053b63e727 /src/corelib/mimetypes/qmimeprovider.cpp
parenta2cec17407b83aed23b01065f4e10d32008552e1 (diff)
Port the QXmlStream API from QStringRef to QStringView
This gives some source incompatibilities, most of them can be handled by using auto instead of QStringRef explicitly. [ChangeLog][Important API changes] QXmlStream now uses QStringView insteead of QStringRef in it's API. Using auto forvariables returning a QStringRef in Qt 5 should lead to code that can be used against both Qt versions. Fixes: QTBUG-84317 Change-Id: I6df3a9507276f5d16d044a6bdbe0e4810cf99440 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/corelib/mimetypes/qmimeprovider.cpp')
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index 47b5e42167..6766a1bbec 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -517,14 +517,14 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
if (xml.name() != QLatin1String("mime-type")) {
continue;
}
- const QStringRef name = xml.attributes().value(QLatin1String("type"));
+ const auto name = xml.attributes().value(QLatin1String("type"));
if (name.isEmpty())
continue;
if (name.compare(data.name, Qt::CaseInsensitive))
qWarning() << "Got name" << name << "in file" << file << "expected" << data.name;
while (xml.readNextStartElement()) {
- const QStringRef tag = xml.name();
+ const auto tag = xml.name();
if (tag == QLatin1String("comment")) {
QString lang = xml.attributes().value(QLatin1String("xml:lang")).toString();
const QString text = xml.readElementText();