summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-05 18:12:42 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-09 21:46:43 +0100
commitb17ccb8af9f9149d100e391af9e1c25e97a962d0 (patch)
tree2ed22a5c36b4e938a801500b7bd8e2773b9fe503
parentdab0d62b655ce9a476993de2558a573a5066288c (diff)
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 <mitch.curtis@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/imports.qdoc2
-rw-r--r--src/qml/qml/qqmlengine.cpp4
-rw-r--r--src/qml/qml/qqmlimport.cpp4
-rw-r--r--tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp8
-rw-r--r--tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp2
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp4
-rw-r--r--tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp2
-rw-r--r--tests/auto/qml/qqmlimport/tst_qqmlimport.cpp4
-rw-r--r--tools/qmlimportscanner/main.cpp2
-rw-r--r--tools/qmllint/main.cpp2
10 files changed, 17 insertions, 17 deletions
diff --git a/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc b/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc
index fdba452271..4a350877ca 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc
@@ -289,7 +289,7 @@ default locations to be searched by the engine. By default, this list contains:
\list
\li The directory of the current file
-\li The location specified by QLibraryInfo::Qml2ImportsPath
+\li The location specified by QLibraryInfo::QmlImportsPath
\li Paths specified by the \c QML2_IMPORT_PATH environment variable
\li The qrc:/qt-project.org/imports path inside the resources.
\endlist
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 9b410bd1bf..eb0d2f24f3 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -1920,7 +1920,7 @@ void QQmlEngine::addImportPath(const QString& path)
By default, the list contains the directory of the application executable,
paths specified in the \c QML2_IMPORT_PATH environment variable,
- and the builtin \c Qml2ImportsPath from QLibraryInfo.
+ and the builtin \c QmlImportsPath from QLibraryInfo.
\sa addImportPath(), setImportPathList()
*/
@@ -1936,7 +1936,7 @@ QStringList QQmlEngine::importPathList() const
By default, the list contains the directory of the application executable,
paths specified in the \c QML2_IMPORT_PATH environment variable,
- and the builtin \c Qml2ImportsPath from QLibraryInfo.
+ and the builtin \c QmlImportsPath from QLibraryInfo.
\sa importPathList(), addImportPath()
*/
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 4e6a4a8928..7fa9277ab3 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1942,9 +1942,9 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
: engine(e)
{
filePluginPath << QLatin1String(".");
- // Search order is applicationDirPath(), qrc:/qt-project.org/imports, $QML2_IMPORT_PATH, QLibraryInfo::Qml2ImportsPath
+ // Search order is applicationDirPath(), qrc:/qt-project.org/imports, $QML2_IMPORT_PATH, QLibraryInfo::QmlImportsPath
- QString installImportsPath = QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath);
+ QString installImportsPath = QLibraryInfo::path(QLibraryInfo::QmlImportsPath);
addImportPath(installImportsPath);
// env import paths
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<QString>("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<void(QProcess &)> 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<QString> 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
diff --git a/tools/qmlimportscanner/main.cpp b/tools/qmlimportscanner/main.cpp
index 20f4a46d34..9313dee634 100644
--- a/tools/qmlimportscanner/main.cpp
+++ b/tools/qmlimportscanner/main.cpp
@@ -76,7 +76,7 @@ void printUsage(const QString &appNameIn)
{
const std::wstring appName = appNameIn.toStdWString();
#ifndef QT_BOOTSTRAPPED
- const QString qmlPath = QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath);
+ const QString qmlPath = QLibraryInfo::path(QLibraryInfo::QmlImportsPath);
#else
const QString qmlPath = QStringLiteral("/home/user/dev/qt-install/qml");
#endif
diff --git a/tools/qmllint/main.cpp b/tools/qmllint/main.cpp
index 428925c2e8..b41b0dcb3d 100644
--- a/tools/qmllint/main.cpp
+++ b/tools/qmllint/main.cpp
@@ -160,7 +160,7 @@ int main(int argv, char *argc[])
QStringList qmlImportPaths = parser.isSet(qmlImportPathsOption)
? parser.values(qmlImportPathsOption)
# ifndef QT_BOOTSTRAPPED
- : QStringList { QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath), QDir::currentPath() };
+ : QStringList { QLibraryInfo::path(QLibraryInfo::QmlImportsPath), QDir::currentPath() };
# else
: QStringList { QDir::currentPath() };
# endif