forked from qt-creator/qt-creator
QmlJS: Fix build with Qt5.14
Amends af88a7876b.
Change-Id: If3f45922dd822797d477ac8116b4fcbed86c746a
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#include "qmlimportresolver_p.h"
|
#include "qmlimportresolver_p.h"
|
||||||
|
|
||||||
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
QT_QML_BEGIN_NAMESPACE
|
QT_QML_BEGIN_NAMESPACE
|
||||||
|
|
||||||
enum ImportVersion { FullyVersioned, PartiallyVersioned, Unversioned };
|
enum ImportVersion { FullyVersioned, PartiallyVersioned, Unversioned };
|
||||||
@@ -46,7 +48,14 @@ QStringList qQmlResolveImportPaths(QStringView uri, const QStringList &basePaths
|
|||||||
static const QLatin1Char Slash('/');
|
static const QLatin1Char Slash('/');
|
||||||
static const QLatin1Char Backslash('\\');
|
static const QLatin1Char Backslash('\\');
|
||||||
|
|
||||||
const QList<QStringView> parts = uri.split(u'.', Qt::SkipEmptyParts);
|
const QList<QStringView> parts
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 2)
|
||||||
|
= uri.split(u'.', Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
|
= Utils::transform(uri.toString().split('.', Qt::SkipEmptyParts), [](const QString &s) {
|
||||||
|
return QStringView(s);
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
QStringList importPaths;
|
QStringList importPaths;
|
||||||
// fully & partially versioned parts + 1 unversioned for each base path
|
// fully & partially versioned parts + 1 unversioned for each base path
|
||||||
@@ -72,7 +81,7 @@ QStringList qQmlResolveImportPaths(QStringView uri, const QStringList &basePaths
|
|||||||
for (auto it = refs.cbegin(); it != refs.cend(); ++it) {
|
for (auto it = refs.cbegin(); it != refs.cend(); ++it) {
|
||||||
if (it != refs.cbegin())
|
if (it != refs.cbegin())
|
||||||
str += sep;
|
str += sep;
|
||||||
str += *it;
|
str += (*it).toString();
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1582,7 +1582,7 @@ QString Type::toString() const
|
|||||||
void Type::toString(QString *out) const
|
void Type::toString(QString *out) const
|
||||||
{
|
{
|
||||||
for (QmlJS::AST::UiQualifiedId *it = typeId; it; it = it->next) {
|
for (QmlJS::AST::UiQualifiedId *it = typeId; it; it = it->next) {
|
||||||
out->append(it->name);
|
out->append(it->name.toString());
|
||||||
|
|
||||||
if (it->next)
|
if (it->next)
|
||||||
out->append(QLatin1Char('.'));
|
out->append(QLatin1Char('.'));
|
||||||
|
|||||||
Reference in New Issue
Block a user