diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp index 177895ff6c..74fc0a269f 100644 --- a/src/corelib/mimetypes/qmimeprovider.cpp +++ b/src/corelib/mimetypes/qmimeprovider.cpp @@ -453,13 +453,14 @@ void QMimeBinaryProvider::loadMimeTypeList() m_mimetypeNames.clear(); // Unfortunately mime.cache doesn't have a full list of all mimetypes. // So we have to parse the plain-text files called "types". - QFile file(m_directory + QStringLiteral("/types")); + QFile file(m_directory + QStringView(u"/types")); if (file.open(QIODevice::ReadOnly)) { while (!file.atEnd()) { - QByteArray line = file.readLine(); - if (line.endsWith('\n')) - line.chop(1); - m_mimetypeNames.insert(QString::fromLatin1(line)); + const QByteArray line = file.readLine(); + auto lineView = QByteArrayView(line); + if (lineView.endsWith('\n')) + lineView.chop(1); + m_mimetypeNames.insert(QString::fromLatin1(lineView)); } } } @@ -717,7 +718,7 @@ void QMimeXMLProvider::findByMagic(const QByteArray &data, int *accuracyPtr, QMi void QMimeXMLProvider::ensureLoaded() { QStringList allFiles; - const QString packageDir = m_directory + QStringLiteral("/packages"); + const QString packageDir = m_directory + QStringView(u"/packages"); QDir dir(packageDir); const QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot); allFiles.reserve(files.size());