From 557623cc4f22295e5e89462dfdff20d78b3b9cdc Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 4 Sep 2020 09:45:26 +0200 Subject: Rename QLibraryInfo::location() to path() As per ### Qt6 comment. Also rename the LibraryLocation enum to LibraryPath. Change-Id: I556025a19c5bcdf2ff52598eaba32269522d4128 Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qsharedpointer/externaltests.cpp | 2 +- tests/auto/gui/util/qundogroup/tst_qundogroup.cpp | 2 +- tests/auto/gui/util/qundostack/tst_qundostack.cpp | 2 +- tests/auto/testlib/selftests/findtestdata/findtestdata.cpp | 2 +- tests/auto/tools/moc/tst_moc.cpp | 2 +- tests/auto/tools/qdbuscpp2xml/tst_qdbuscpp2xml.cpp | 2 +- tests/auto/tools/qdbusxml2cpp/tst_qdbusxml2cpp.cpp | 2 +- tests/auto/tools/qmake/tst_qmake.cpp | 4 ++-- tests/auto/tools/rcc/tst_rcc.cpp | 2 +- tests/auto/tools/uic/tst_uic.cpp | 2 +- tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp | 10 +++++----- 11 files changed, 16 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp index 21ef6e8e35..11487d4b3e 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp @@ -590,7 +590,7 @@ namespace QTest { << QLatin1String("project.pro"); qmake.setWorkingDirectory(temporaryDirPath); - QString cmd = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmake"; + QString cmd = QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmake"; #ifdef Q_OS_WIN cmd.append(".exe"); #endif diff --git a/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp b/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp index 5f82bd8442..e915fd7e24 100644 --- a/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp +++ b/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp @@ -592,7 +592,7 @@ void tst_QUndoGroup::commandTextFormat() #if !QT_CONFIG(process) QSKIP("No QProcess available"); #else - QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath); + QString binDir = QLibraryInfo::path(QLibraryInfo::BinariesPath); if (QProcess::execute(binDir + "/lrelease -version") != 0) QSKIP("lrelease is missing or broken"); diff --git a/tests/auto/gui/util/qundostack/tst_qundostack.cpp b/tests/auto/gui/util/qundostack/tst_qundostack.cpp index 9415f1325c..4c201ba4f9 100644 --- a/tests/auto/gui/util/qundostack/tst_qundostack.cpp +++ b/tests/auto/gui/util/qundostack/tst_qundostack.cpp @@ -3856,7 +3856,7 @@ void tst_QUndoStack::commandTextFormat() #if !QT_CONFIG(process) QSKIP("No QProcess available"); #else - QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath); + QString binDir = QLibraryInfo::path(QLibraryInfo::BinariesPath); if (QProcess::execute(binDir + "/lrelease -version") != 0) QSKIP("lrelease is missing or broken"); diff --git a/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp b/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp index 7d5857faa0..cccb0023dc 100644 --- a/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp +++ b/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp @@ -56,7 +56,7 @@ void FindTestData::initTestCase() + "/tests"; QVERIFY(QDir("/").mkpath(install_path)); QVERIFY(QDir("/").mkpath(install_path + "/findtestdata")); - QCOMPARE(QLibraryInfo::location(QLibraryInfo::TestsPath), install_path); + QCOMPARE(QLibraryInfo::path(QLibraryInfo::TestsPath), install_path); // make fake source and build directories QVERIFY(QDir("/").mkpath(app_path + "/fakesrc")); diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 8d405d997e..cee6d47dbd 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -772,7 +772,7 @@ private: void tst_Moc::initTestCase() { - QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath); + QString binpath = QLibraryInfo::path(QLibraryInfo::BinariesPath); QString qmake = QString("%1/qmake").arg(binpath); m_moc = QString("%1/moc").arg(binpath); diff --git a/tests/auto/tools/qdbuscpp2xml/tst_qdbuscpp2xml.cpp b/tests/auto/tools/qdbuscpp2xml/tst_qdbuscpp2xml.cpp index 1f6dd5748d..a65c6fbe0b 100644 --- a/tests/auto/tools/qdbuscpp2xml/tst_qdbuscpp2xml.cpp +++ b/tests/auto/tools/qdbuscpp2xml/tst_qdbuscpp2xml.cpp @@ -129,7 +129,7 @@ void tst_qdbuscpp2xml::qdbuscpp2xml() } // Launch - const QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath); + const QString binpath = QLibraryInfo::path(QLibraryInfo::BinariesPath); const QString command = binpath + QLatin1String("/qdbuscpp2xml"); QProcess process; process.start(command, QStringList() << options << (QFINDTESTDATA(inputfile + QStringLiteral(".h")))); diff --git a/tests/auto/tools/qdbusxml2cpp/tst_qdbusxml2cpp.cpp b/tests/auto/tools/qdbusxml2cpp/tst_qdbusxml2cpp.cpp index 0c5ba21134..dd76aef923 100644 --- a/tests/auto/tools/qdbusxml2cpp/tst_qdbusxml2cpp.cpp +++ b/tests/auto/tools/qdbusxml2cpp/tst_qdbusxml2cpp.cpp @@ -218,7 +218,7 @@ void tst_qdbusxml2cpp::process() QFETCH_GLOBAL(QString, commandLineArg); // Run the tool - const QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath); + const QString binpath = QLibraryInfo::path(QLibraryInfo::BinariesPath); const QString command = binpath + QLatin1String("/qdbusxml2cpp"); QProcess process; process.start(command, QStringList() << commandLineArg << "-" << "-N"); diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index 2b9ecddf2b..e524274311 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -117,7 +117,7 @@ static void copyDir(const QString &sourceDirPath, const QString &targetDirPath) void tst_qmake::initTestCase() { QVERIFY2(tempWorkDir.isValid(), qPrintable(tempWorkDir.errorString())); - QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath); + QString binpath = QLibraryInfo::path(QLibraryInfo::BinariesPath); QString cmd = QString("%1/qmake").arg(binpath); #ifdef Q_CC_MSVC const QString jom = QStandardPaths::findExecutable(QLatin1String("jom.exe")); @@ -656,7 +656,7 @@ void tst_qmake::qinstall() // install an executable file { - const QString mocFilePath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + const QString mocFilePath = QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/moc" #ifdef Q_OS_WIN + ".exe" diff --git a/tests/auto/tools/rcc/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp index a3710d46eb..26d2862da7 100644 --- a/tests/auto/tools/rcc/tst_rcc.cpp +++ b/tests/auto/tools/rcc/tst_rcc.cpp @@ -103,7 +103,7 @@ private: void tst_rcc::initTestCase() { - m_rcc = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/rcc"); + m_rcc = QLibraryInfo::path(QLibraryInfo::BinariesPath) + QLatin1String("/rcc"); m_dataPath = QFINDTESTDATA("data"); QVERIFY(!m_dataPath.isEmpty()); diff --git a/tests/auto/tools/uic/tst_uic.cpp b/tests/auto/tools/uic/tst_uic.cpp index 7e4649b7d0..07e508997d 100644 --- a/tests/auto/tools/uic/tst_uic.cpp +++ b/tests/auto/tools/uic/tst_uic.cpp @@ -105,7 +105,7 @@ static const char versionRegexp[] = R"([*#][*#] Created by: Qt User Interface Compiler version \d{1,2}\.\d{1,2}\.\d{1,2})"; tst_uic::tst_uic() - : m_command(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/uic")) + : m_command(QLibraryInfo::path(QLibraryInfo::BinariesPath) + QLatin1String("/uic")) , m_versionRegexp(QLatin1String(versionRegexp)) { } diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 3cb4c58513..54a9499fbf 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -911,7 +911,7 @@ void tst_QApplication::libraryPaths() int argc = 1; QApplication app(argc, &argv0); QString appDirPath = QCoreApplication::applicationDirPath(); - QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath); + QString installPathPlugins = QLibraryInfo::path(QLibraryInfo::PluginsPath); QStringList actual = QApplication::libraryPaths(); actual.sort(); @@ -939,7 +939,7 @@ void tst_QApplication::libraryPaths() // this test doesn't work if KDE 4 is installed QCOMPARE(count, 1); // before creating QApplication, only the PluginsPath is in the libraryPaths() #endif - QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath); + QString installPathPlugins = QLibraryInfo::path(QLibraryInfo::PluginsPath); QApplication::addLibraryPath(installPathPlugins); qCDebug(lcTests) << "installPathPlugins" << installPathPlugins; qCDebug(lcTests) << "After adding plugins path:" << QApplication::libraryPaths(); @@ -963,7 +963,7 @@ void tst_QApplication::libraryPaths() qCDebug(lcTests) << "Initial library path:" << QCoreApplication::libraryPaths(); int count = QCoreApplication::libraryPaths().count(); - QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath); + QString installPathPlugins = QLibraryInfo::path(QLibraryInfo::PluginsPath); QCoreApplication::addLibraryPath(installPathPlugins); qCDebug(lcTests) << "installPathPlugins" << installPathPlugins; qCDebug(lcTests) << "After adding plugins path:" << QCoreApplication::libraryPaths(); @@ -1024,7 +1024,7 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2() // library path list should contain the default plus the one valid path QStringList expected = QStringList() - << QLibraryInfo::location(QLibraryInfo::PluginsPath) + << QLibraryInfo::path(QLibraryInfo::PluginsPath) << QDir(QCoreApplication::applicationDirPath()).canonicalPath() << QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).canonicalPath(); @@ -1045,7 +1045,7 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2() // library path list should contain the default QStringList expected = QStringList() - << QLibraryInfo::location(QLibraryInfo::PluginsPath) + << QLibraryInfo::path(QLibraryInfo::PluginsPath) << QCoreApplication::applicationDirPath(); QVERIFY(isPathListIncluded(QCoreApplication::libraryPaths(), expected)); -- cgit v1.2.3