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 --- examples/widgets/dialogs/classwizard/main.cpp | 2 +- examples/widgets/dialogs/licensewizard/main.cpp | 2 +- examples/widgets/dialogs/standarddialogs/main.cpp | 2 +- .../widgets/dialogs/trivialwizard/trivialwizard.cpp | 2 +- examples/widgets/itemviews/fetchmore/window.cpp | 2 +- qmake/option.cpp | 2 +- qmake/property.cpp | 4 ++-- src/corelib/global/qlibraryinfo.cpp | 21 ++++++++++++++------- src/corelib/global/qlibraryinfo.h | 12 +++++++++--- src/corelib/io/qloggingregistry.cpp | 2 +- src/corelib/io/qsettings.cpp | 4 ++-- src/corelib/kernel/qcoreapplication.cpp | 2 +- src/gui/text/qplatformfontdatabase.cpp | 2 +- .../platforms/windows/qwindowsopengltester.cpp | 2 +- src/testlib/qtestcase.cpp | 2 +- .../corelib/tools/qsharedpointer/externaltests.cpp | 2 +- tests/auto/gui/util/qundogroup/tst_qundogroup.cpp | 2 +- tests/auto/gui/util/qundostack/tst_qundostack.cpp | 2 +- .../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 +- .../kernel/qapplication/tst_qapplication.cpp | 10 +++++----- 26 files changed, 54 insertions(+), 41 deletions(-) diff --git a/examples/widgets/dialogs/classwizard/main.cpp b/examples/widgets/dialogs/classwizard/main.cpp index 901ef91265..612d194c06 100644 --- a/examples/widgets/dialogs/classwizard/main.cpp +++ b/examples/widgets/dialogs/classwizard/main.cpp @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) QString translatorFileName = QLatin1String("qtbase_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); - if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + if (translator->load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath))) app.installTranslator(translator); #endif diff --git a/examples/widgets/dialogs/licensewizard/main.cpp b/examples/widgets/dialogs/licensewizard/main.cpp index 88eb59c88e..47fdb4a09d 100644 --- a/examples/widgets/dialogs/licensewizard/main.cpp +++ b/examples/widgets/dialogs/licensewizard/main.cpp @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) QString translatorFileName = QLatin1String("qtbase_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); - if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + if (translator->load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath))) app.installTranslator(translator); #endif diff --git a/examples/widgets/dialogs/standarddialogs/main.cpp b/examples/widgets/dialogs/standarddialogs/main.cpp index 42be1ad34b..3892c02f9d 100644 --- a/examples/widgets/dialogs/standarddialogs/main.cpp +++ b/examples/widgets/dialogs/standarddialogs/main.cpp @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) QString translatorFileName = QLatin1String("qtbase_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); - if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + if (translator->load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath))) app.installTranslator(translator); #endif diff --git a/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp b/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp index 4c87327cd3..e214a4e54a 100644 --- a/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp +++ b/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) QString translatorFileName = QLatin1String("qtbase_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); - if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + if (translator->load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath))) app.installTranslator(translator); #endif diff --git a/examples/widgets/itemviews/fetchmore/window.cpp b/examples/widgets/itemviews/fetchmore/window.cpp index d71ac7059d..fa23bddc73 100644 --- a/examples/widgets/itemviews/fetchmore/window.cpp +++ b/examples/widgets/itemviews/fetchmore/window.cpp @@ -57,7 +57,7 @@ Window::Window(QWidget *parent) : QWidget(parent) { FileListModel *model = new FileListModel(this); - model->setDirPath(QLibraryInfo::location(QLibraryInfo::PrefixPath)); + model->setDirPath(QLibraryInfo::path(QLibraryInfo::PrefixPath)); QLabel *label = new QLabel(tr("&Directory:")); QLineEdit *lineEdit = new QLineEdit; diff --git a/qmake/option.cpp b/qmake/option.cpp index 58688ab2d6..df8a5742a1 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -218,7 +218,7 @@ Option::parseCommandLine(QStringList &args, QMakeCmdLineParserState &state) "QMake version %s\n" "Using Qt version %s in %s\n", QMAKE_VERSION_STR, QT_VERSION_STR, - QLibraryInfo::location(QLibraryInfo::LibrariesPath).toLatin1().constData()); + QLibraryInfo::path(QLibraryInfo::LibrariesPath).toLatin1().constData()); #ifdef QMAKE_OPENSOURCE_VERSION fprintf(stdout, "QMake is Open Source software from The Qt Company Ltd and/or its subsidiary(-ies).\n"); #endif diff --git a/qmake/property.cpp b/qmake/property.cpp index 31d6cdc9d6..971607ef61 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -39,7 +39,7 @@ QT_BEGIN_NAMESPACE static const struct { const char *name; - QLibraryInfo::LibraryLocation loc; + QLibraryInfo::LibraryPath loc; bool raw; bool singular; } propList[] = { @@ -84,7 +84,7 @@ void QMakeProperty::reload() QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths); if (!propList[i].raw) { m_values[ProKey(name + "/dev")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::DevicePaths); - m_values[ProKey(name)] = QLibraryInfo::location(propList[i].loc); + m_values[ProKey(name)] = QLibraryInfo::path(propList[i].loc); name += "/raw"; } m_values[ProKey(name)] = val; diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 1380b08372..f2601babfc 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -356,7 +356,7 @@ QVersionNumber QLibraryInfo::version() noexcept #endif // QT_BUILD_QMAKE /* - * To add a new entry in QLibrary::LibraryLocation, add it to the enum above the bootstrapped values and: + * To add a new entry in QLibrary::LibraryPath, add it to the enum above the bootstrapped values and: * - add its relative path in the qtConfEntries[] array below * (the key is what appears in a qt.conf file) * - add a property name in qmake/property.cpp propList[] array @@ -636,12 +636,19 @@ static QString getPrefix( } #endif // QT_BUILD_QMAKE_BOOTSTRAP +/*! \fn QString QLibraryInfo::path(LibraryPath loc) + \obsolete Use path() instead. + + Returns the path specified by \a loc. + \sa path() +*/ + /*! - Returns the location specified by \a loc. + Returns the path specified by \a p. */ -QString -QLibraryInfo::location(LibraryLocation loc) +QString QLibraryInfo::path(LibraryPath p) { + const LibraryPath loc = p; #ifdef QT_BUILD_QMAKE // ends inside rawLocation ! QString ret = rawLocation(loc, FinalPaths); @@ -653,7 +660,7 @@ QLibraryInfo::location(LibraryLocation loc) } QString -QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) +QLibraryInfo::rawLocation(LibraryPath loc, PathGroup group) { #endif // QT_BUILD_QMAKE, started inside location ! QString ret; @@ -803,7 +810,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) baseDir = prefixFromAppDirHelper(); } else { // we make any other path absolute to the prefix directory - baseDir = location(PrefixPath); + baseDir = path(PrefixPath); } #endif // QT_BUILD_QMAKE ret = QDir::cleanPath(baseDir + QLatin1Char('/') + ret); @@ -842,7 +849,7 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) } /*! - \enum QLibraryInfo::LibraryLocation + \enum QLibraryInfo::LibraryPath \keyword library location diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index 4a14a9728a..3ceb20336b 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -59,7 +59,7 @@ public: static QVersionNumber version() noexcept Q_DECL_CONST_FUNCTION; #endif - enum LibraryLocation + enum LibraryPath { PrefixPath = 0, DocumentationPath, @@ -90,10 +90,16 @@ public: #endif SettingsPath = 100 }; - static QString location(LibraryLocation); // ### Qt 6: consider renaming it to path() + static QString path(LibraryPath p); +#if QT_DEPRECATED_SINCE(6, 0) + using LibraryLocation = LibraryPath; + QT_DEPRECATED_VERSION_X_6_0("Use path()") + static QString location(LibraryLocation location) + { return path(location); } +#endif #ifdef QT_BUILD_QMAKE enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths, DevicePaths }; - static QString rawLocation(LibraryLocation, PathGroup); + static QString rawLocation(LibraryPath, PathGroup); static void reload(); static void sysrootify(QString *path); #endif diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp index 91d3e5a73c..e1e35a07ed 100644 --- a/src/corelib/io/qloggingregistry.cpp +++ b/src/corelib/io/qloggingregistry.cpp @@ -324,7 +324,7 @@ void QLoggingRegistry::initializeRules() #if !defined(QT_BOOTSTRAPPED) // get rules from Qt data configuration path const QString qtConfigPath - = QDir(QLibraryInfo::location(QLibraryInfo::DataPath)).absoluteFilePath(configFileName); + = QDir(QLibraryInfo::path(QLibraryInfo::DataPath)).absoluteFilePath(configFileName); qr = loadRulesFromFile(qtConfigPath); #endif diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 0a62ffb2be..42a0f38be3 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -992,11 +992,11 @@ static std::unique_lock initDefaultPaths(std::unique_lockisEmpty()) { diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index c89197e219..dd52242c6f 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -2706,7 +2706,7 @@ QStringList QCoreApplication::libraryPathsLocked() } #endif // Q_OS_DARWIN - QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath); + QString installPathPlugins = QLibraryInfo::path(QLibraryInfo::PluginsPath); if (QFile::exists(installPathPlugins)) { // Make sure we convert from backslashes to slashes. installPathPlugins = QDir(installPathPlugins).canonicalPath(); diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp index d54bda4941..21d43a249f 100644 --- a/src/gui/text/qplatformfontdatabase.cpp +++ b/src/gui/text/qplatformfontdatabase.cpp @@ -357,7 +357,7 @@ QString QPlatformFontDatabase::fontDir() const { QString fontpath = QString::fromLocal8Bit(qgetenv("QT_QPA_FONTDIR")); if (fontpath.isEmpty()) - fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath) + QLatin1String("/fonts"); + fontpath = QLibraryInfo::path(QLibraryInfo::LibrariesPath) + QLatin1String("/fonts"); return fontpath; } diff --git a/src/plugins/platforms/windows/qwindowsopengltester.cpp b/src/plugins/platforms/windows/qwindowsopengltester.cpp index 00ac7fa2b7..0c348a9b71 100644 --- a/src/plugins/platforms/windows/qwindowsopengltester.cpp +++ b/src/plugins/platforms/windows/qwindowsopengltester.cpp @@ -263,7 +263,7 @@ static inline QString resolveBugListFile(const QString &fileName) return fileName; // Try QLibraryInfo::SettingsPath which is typically empty unless specified in qt.conf, // then resolve via QStandardPaths::ConfigLocation. - const QString settingsPath = QLibraryInfo::location(QLibraryInfo::SettingsPath); + const QString settingsPath = QLibraryInfo::path(QLibraryInfo::SettingsPath); if (!settingsPath.isEmpty()) { // SettingsPath is empty unless specified in qt.conf. const QFileInfo fi(settingsPath + u'/' + fileName); if (fi.isFile()) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 0202915e67..ac8eeb6c27 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2193,7 +2193,7 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co if (found.isEmpty()) { const char *testObjectName = QTestResult::currentTestObjectName(); if (testObjectName) { - const QString testsPath = QLibraryInfo::location(QLibraryInfo::TestsPath); + const QString testsPath = QLibraryInfo::path(QLibraryInfo::TestsPath); const QString candidate = QString::fromLatin1("%1/%2/%3") .arg(testsPath, QFile::decodeName(testObjectName).toLower(), base); if (QFileInfo::exists(candidate)) { 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