From aa51b3bf4ea854ffe7b39403289689daa428b221 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 27 Mar 2019 14:56:37 +0100 Subject: Avoid redundant slashes when creating qmldir URLs If the path starts with ":" and we assume it's an absolute qrc path, the only thing we need to do to make it a URL is prepend "qrc". Fixes: QTBUG-74677 Change-Id: Iee0239296b6f48ce909db02ae16e24dfc745b637 Reviewed-by: Lars Knoll --- src/qml/qml/qqmlimport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index a31dbd1e08..a79d4d074c 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -1331,7 +1331,7 @@ bool QQmlImportsPrivate::locateQmldir(const QString &uri, int vmaj, int vmin, QQ QString url; const QStringRef absolutePath = absoluteFilePath.leftRef(absoluteFilePath.lastIndexOf(Slash) + 1); if (absolutePath.at(0) == Colon) - url = QLatin1String("qrc://") + absolutePath.mid(1); + url = QLatin1String("qrc") + absolutePath; else url = QUrl::fromLocalFile(absolutePath.toString()).toString(); -- cgit v1.2.3