From b17ccb8af9f9149d100e391af9e1c25e97a962d0 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 5 Feb 2021 18:12:42 +0100 Subject: Use QLibraryInfo::QmlImportsPath rather than Qml2ImportsPath The "2" is meaningless and there is a better name available now. Task-number: QTBUG-85064 Change-Id: I65d26b06712ed7dcf2825f16dffaa6060dd86985 Reviewed-by: Mitch Curtis Reviewed-by: Andrei Golubev --- tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp | 8 ++++---- tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp | 2 +- tests/auto/qml/qmllint/tst_qmllint.cpp | 4 ++-- tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp | 2 +- tests/auto/qml/qqmlimport/tst_qqmlimport.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp b/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp index 41b52a0a6b..04f9b1fe0c 100644 --- a/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp +++ b/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp @@ -245,18 +245,18 @@ void tst_QQmlPreview::blacklist() blacklist2.blacklist(":/qt-project.org"); blacklist2.blacklist(":/QtQuick/Controls/Styles"); blacklist2.blacklist(":/ExtrasImports/QtQuick/Controls/Styles"); - blacklist2.blacklist(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath)); + blacklist2.blacklist(QLibraryInfo::path(QLibraryInfo::QmlImportsPath)); blacklist2.blacklist("/home/ulf/.local/share/QtProject/Qml Runtime/configuration.qml"); blacklist2.blacklist("/usr/share"); blacklist2.blacklist("/usr/share/QtProject/Qml Runtime/configuration.qml"); - QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath))); + QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::path(QLibraryInfo::QmlImportsPath))); blacklist2.blacklist("/usr/local/share/QtProject/Qml Runtime/configuration.qml"); blacklist2.blacklist("qml"); blacklist2.blacklist(""); // This should not remove all other paths. - QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath) + + QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::path(QLibraryInfo::QmlImportsPath) + "/QtQuick/Window.2.0")); - QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath))); + QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::path(QLibraryInfo::QmlImportsPath))); QVERIFY(blacklist2.isBlacklisted("/usr/share/QtProject/Qml Runtime/configuration.qml")); QVERIFY(blacklist2.isBlacklisted("/usr/share/stuff")); QVERIFY(blacklist2.isBlacklisted("")); diff --git a/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp b/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp index cfcec61f82..ca11d00915 100644 --- a/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp +++ b/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp @@ -121,7 +121,7 @@ void TestQmlimportscanner::runQmlimportscanner(const QString &mode, const QStrin const QString file(pathToScan); QStringList args { mode, file, - "-importPath", QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath), dataDirectory() + "-importPath", QLibraryInfo::path(QLibraryInfo::QmlImportsPath), dataDirectory() }; QString errors; QProcess process; diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index dc84e1c535..1486a9e1d3 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -155,7 +155,7 @@ void TestQmllint::qmltypes_data() { QTest::addColumn("file"); - const QString importsPath = QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath); + const QString importsPath = QLibraryInfo::path(QLibraryInfo::QmlImportsPath); QDirIterator it(importsPath, { "*.qmltypes" }, QDir::Files, QDirIterator::Subdirectories); while (it.hasNext()) @@ -359,7 +359,7 @@ QString TestQmllint::runQmllint(const QString &fileToLint, std::function handleResult, const QStringList &extraArgs) { - auto qmlImportDir = QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath); + auto qmlImportDir = QLibraryInfo::path(QLibraryInfo::QmlImportsPath); QStringList args; args << (QFileInfo(fileToLint).isAbsolute() ? fileToLint : testFile(fileToLint)) diff --git a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp index c9fe00a837..e3c8151884 100644 --- a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp +++ b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp @@ -76,7 +76,7 @@ private Q_SLOTS: void tst_qqmlextensionplugin::iidCheck_data() { QList files; - for (QDirIterator it(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath), QDirIterator::Subdirectories); it.hasNext(); ) { + for (QDirIterator it(QLibraryInfo::path(QLibraryInfo::QmlImportsPath), QDirIterator::Subdirectories); it.hasNext(); ) { QString file = it.next(); #if defined(Q_OS_DARWIN) if (file.contains(QLatin1String(".dSYM/"))) diff --git a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp index 8229b79702..92565cc591 100644 --- a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp +++ b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp @@ -166,11 +166,11 @@ void tst_QQmlImport::uiFormatLoading() void tst_QQmlImport::importPathOrder() { #ifdef Q_OS_ANDROID - QSKIP("QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath) returns bogus path on Android, but its nevertheless unusable."); + QSKIP("QLibraryInfo::path(QLibraryInfo::QmlImportsPath) returns bogus path on Android, but its nevertheless unusable."); #endif QStringList expectedImportPaths; QString appDirPath = QCoreApplication::applicationDirPath(); - QString qml2Imports = QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath); + QString qml2Imports = QLibraryInfo::path(QLibraryInfo::QmlImportsPath); #ifdef Q_OS_WIN // The drive letter has a different case as QQmlImport will // cause it to be converted after passing through QUrl -- cgit v1.2.3