Rename QLibraryInfo::location() to path()
As per ### Qt6 comment. Also rename the LibraryLocation enum to LibraryPath. Change-Id: I556025a19c5bcdf2ff52598eaba32269522d4128 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
d24174918f
commit
557623cc4f
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
|||||||
QString translatorFileName = QLatin1String("qtbase_");
|
QString translatorFileName = QLatin1String("qtbase_");
|
||||||
translatorFileName += QLocale::system().name();
|
translatorFileName += QLocale::system().name();
|
||||||
QTranslator *translator = new QTranslator(&app);
|
QTranslator *translator = new QTranslator(&app);
|
||||||
if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
if (translator->load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
|
||||||
app.installTranslator(translator);
|
app.installTranslator(translator);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
|||||||
QString translatorFileName = QLatin1String("qtbase_");
|
QString translatorFileName = QLatin1String("qtbase_");
|
||||||
translatorFileName += QLocale::system().name();
|
translatorFileName += QLocale::system().name();
|
||||||
QTranslator *translator = new QTranslator(&app);
|
QTranslator *translator = new QTranslator(&app);
|
||||||
if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
if (translator->load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
|
||||||
app.installTranslator(translator);
|
app.installTranslator(translator);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
QString translatorFileName = QLatin1String("qtbase_");
|
QString translatorFileName = QLatin1String("qtbase_");
|
||||||
translatorFileName += QLocale::system().name();
|
translatorFileName += QLocale::system().name();
|
||||||
QTranslator *translator = new QTranslator(&app);
|
QTranslator *translator = new QTranslator(&app);
|
||||||
if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
if (translator->load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
|
||||||
app.installTranslator(translator);
|
app.installTranslator(translator);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ int main(int argc, char *argv[])
|
|||||||
QString translatorFileName = QLatin1String("qtbase_");
|
QString translatorFileName = QLatin1String("qtbase_");
|
||||||
translatorFileName += QLocale::system().name();
|
translatorFileName += QLocale::system().name();
|
||||||
QTranslator *translator = new QTranslator(&app);
|
QTranslator *translator = new QTranslator(&app);
|
||||||
if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
if (translator->load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
|
||||||
app.installTranslator(translator);
|
app.installTranslator(translator);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ Window::Window(QWidget *parent)
|
|||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
FileListModel *model = new FileListModel(this);
|
FileListModel *model = new FileListModel(this);
|
||||||
model->setDirPath(QLibraryInfo::location(QLibraryInfo::PrefixPath));
|
model->setDirPath(QLibraryInfo::path(QLibraryInfo::PrefixPath));
|
||||||
|
|
||||||
QLabel *label = new QLabel(tr("&Directory:"));
|
QLabel *label = new QLabel(tr("&Directory:"));
|
||||||
QLineEdit *lineEdit = new QLineEdit;
|
QLineEdit *lineEdit = new QLineEdit;
|
||||||
|
@ -218,7 +218,7 @@ Option::parseCommandLine(QStringList &args, QMakeCmdLineParserState &state)
|
|||||||
"QMake version %s\n"
|
"QMake version %s\n"
|
||||||
"Using Qt version %s in %s\n",
|
"Using Qt version %s in %s\n",
|
||||||
QMAKE_VERSION_STR, QT_VERSION_STR,
|
QMAKE_VERSION_STR, QT_VERSION_STR,
|
||||||
QLibraryInfo::location(QLibraryInfo::LibrariesPath).toLatin1().constData());
|
QLibraryInfo::path(QLibraryInfo::LibrariesPath).toLatin1().constData());
|
||||||
#ifdef QMAKE_OPENSOURCE_VERSION
|
#ifdef QMAKE_OPENSOURCE_VERSION
|
||||||
fprintf(stdout, "QMake is Open Source software from The Qt Company Ltd and/or its subsidiary(-ies).\n");
|
fprintf(stdout, "QMake is Open Source software from The Qt Company Ltd and/or its subsidiary(-ies).\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,7 +39,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
QLibraryInfo::LibraryLocation loc;
|
QLibraryInfo::LibraryPath loc;
|
||||||
bool raw;
|
bool raw;
|
||||||
bool singular;
|
bool singular;
|
||||||
} propList[] = {
|
} propList[] = {
|
||||||
@ -84,7 +84,7 @@ void QMakeProperty::reload()
|
|||||||
QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths);
|
QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths);
|
||||||
if (!propList[i].raw) {
|
if (!propList[i].raw) {
|
||||||
m_values[ProKey(name + "/dev")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::DevicePaths);
|
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";
|
name += "/raw";
|
||||||
}
|
}
|
||||||
m_values[ProKey(name)] = val;
|
m_values[ProKey(name)] = val;
|
||||||
|
@ -356,7 +356,7 @@ QVersionNumber QLibraryInfo::version() noexcept
|
|||||||
#endif // QT_BUILD_QMAKE
|
#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
|
* - add its relative path in the qtConfEntries[] array below
|
||||||
* (the key is what appears in a qt.conf file)
|
* (the key is what appears in a qt.conf file)
|
||||||
* - add a property name in qmake/property.cpp propList[] array
|
* - add a property name in qmake/property.cpp propList[] array
|
||||||
@ -636,12 +636,19 @@ static QString getPrefix(
|
|||||||
}
|
}
|
||||||
#endif // QT_BUILD_QMAKE_BOOTSTRAP
|
#endif // QT_BUILD_QMAKE_BOOTSTRAP
|
||||||
|
|
||||||
/*!
|
/*! \fn QString QLibraryInfo::path(LibraryPath loc)
|
||||||
Returns the location specified by \a loc.
|
\obsolete Use path() instead.
|
||||||
|
|
||||||
|
Returns the path specified by \a loc.
|
||||||
|
\sa path()
|
||||||
*/
|
*/
|
||||||
QString
|
|
||||||
QLibraryInfo::location(LibraryLocation loc)
|
/*!
|
||||||
|
Returns the path specified by \a p.
|
||||||
|
*/
|
||||||
|
QString QLibraryInfo::path(LibraryPath p)
|
||||||
{
|
{
|
||||||
|
const LibraryPath loc = p;
|
||||||
#ifdef QT_BUILD_QMAKE // ends inside rawLocation !
|
#ifdef QT_BUILD_QMAKE // ends inside rawLocation !
|
||||||
QString ret = rawLocation(loc, FinalPaths);
|
QString ret = rawLocation(loc, FinalPaths);
|
||||||
|
|
||||||
@ -653,7 +660,7 @@ QLibraryInfo::location(LibraryLocation loc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
|
QLibraryInfo::rawLocation(LibraryPath loc, PathGroup group)
|
||||||
{
|
{
|
||||||
#endif // QT_BUILD_QMAKE, started inside location !
|
#endif // QT_BUILD_QMAKE, started inside location !
|
||||||
QString ret;
|
QString ret;
|
||||||
@ -803,7 +810,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
|
|||||||
baseDir = prefixFromAppDirHelper();
|
baseDir = prefixFromAppDirHelper();
|
||||||
} else {
|
} else {
|
||||||
// we make any other path absolute to the prefix directory
|
// we make any other path absolute to the prefix directory
|
||||||
baseDir = location(PrefixPath);
|
baseDir = path(PrefixPath);
|
||||||
}
|
}
|
||||||
#endif // QT_BUILD_QMAKE
|
#endif // QT_BUILD_QMAKE
|
||||||
ret = QDir::cleanPath(baseDir + QLatin1Char('/') + ret);
|
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
|
\keyword library location
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
static QVersionNumber version() noexcept Q_DECL_CONST_FUNCTION;
|
static QVersionNumber version() noexcept Q_DECL_CONST_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum LibraryLocation
|
enum LibraryPath
|
||||||
{
|
{
|
||||||
PrefixPath = 0,
|
PrefixPath = 0,
|
||||||
DocumentationPath,
|
DocumentationPath,
|
||||||
@ -90,10 +90,16 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
SettingsPath = 100
|
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
|
#ifdef QT_BUILD_QMAKE
|
||||||
enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths, DevicePaths };
|
enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths, DevicePaths };
|
||||||
static QString rawLocation(LibraryLocation, PathGroup);
|
static QString rawLocation(LibraryPath, PathGroup);
|
||||||
static void reload();
|
static void reload();
|
||||||
static void sysrootify(QString *path);
|
static void sysrootify(QString *path);
|
||||||
#endif
|
#endif
|
||||||
|
@ -324,7 +324,7 @@ void QLoggingRegistry::initializeRules()
|
|||||||
#if !defined(QT_BOOTSTRAPPED)
|
#if !defined(QT_BOOTSTRAPPED)
|
||||||
// get rules from Qt data configuration path
|
// get rules from Qt data configuration path
|
||||||
const QString qtConfigPath
|
const QString qtConfigPath
|
||||||
= QDir(QLibraryInfo::location(QLibraryInfo::DataPath)).absoluteFilePath(configFileName);
|
= QDir(QLibraryInfo::path(QLibraryInfo::DataPath)).absoluteFilePath(configFileName);
|
||||||
qr = loadRulesFromFile(qtConfigPath);
|
qr = loadRulesFromFile(qtConfigPath);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -992,11 +992,11 @@ static std::unique_lock<QBasicMutex> initDefaultPaths(std::unique_lock<QBasicMut
|
|||||||
locker.unlock();
|
locker.unlock();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
QLibraryInfo::location() uses QSettings, so in order to
|
QLibraryInfo::path() uses QSettings, so in order to
|
||||||
avoid a dead-lock, we can't hold the global mutex while
|
avoid a dead-lock, we can't hold the global mutex while
|
||||||
calling it.
|
calling it.
|
||||||
*/
|
*/
|
||||||
QString systemPath = QLibraryInfo::location(QLibraryInfo::SettingsPath) + QLatin1Char('/');
|
QString systemPath = QLibraryInfo::path(QLibraryInfo::SettingsPath) + QLatin1Char('/');
|
||||||
|
|
||||||
locker.lock();
|
locker.lock();
|
||||||
if (pathHash->isEmpty()) {
|
if (pathHash->isEmpty()) {
|
||||||
|
@ -2706,7 +2706,7 @@ QStringList QCoreApplication::libraryPathsLocked()
|
|||||||
}
|
}
|
||||||
#endif // Q_OS_DARWIN
|
#endif // Q_OS_DARWIN
|
||||||
|
|
||||||
QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
|
QString installPathPlugins = QLibraryInfo::path(QLibraryInfo::PluginsPath);
|
||||||
if (QFile::exists(installPathPlugins)) {
|
if (QFile::exists(installPathPlugins)) {
|
||||||
// Make sure we convert from backslashes to slashes.
|
// Make sure we convert from backslashes to slashes.
|
||||||
installPathPlugins = QDir(installPathPlugins).canonicalPath();
|
installPathPlugins = QDir(installPathPlugins).canonicalPath();
|
||||||
|
@ -357,7 +357,7 @@ QString QPlatformFontDatabase::fontDir() const
|
|||||||
{
|
{
|
||||||
QString fontpath = QString::fromLocal8Bit(qgetenv("QT_QPA_FONTDIR"));
|
QString fontpath = QString::fromLocal8Bit(qgetenv("QT_QPA_FONTDIR"));
|
||||||
if (fontpath.isEmpty())
|
if (fontpath.isEmpty())
|
||||||
fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath) + QLatin1String("/fonts");
|
fontpath = QLibraryInfo::path(QLibraryInfo::LibrariesPath) + QLatin1String("/fonts");
|
||||||
|
|
||||||
return fontpath;
|
return fontpath;
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ static inline QString resolveBugListFile(const QString &fileName)
|
|||||||
return fileName;
|
return fileName;
|
||||||
// Try QLibraryInfo::SettingsPath which is typically empty unless specified in qt.conf,
|
// Try QLibraryInfo::SettingsPath which is typically empty unless specified in qt.conf,
|
||||||
// then resolve via QStandardPaths::ConfigLocation.
|
// 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.
|
if (!settingsPath.isEmpty()) { // SettingsPath is empty unless specified in qt.conf.
|
||||||
const QFileInfo fi(settingsPath + u'/' + fileName);
|
const QFileInfo fi(settingsPath + u'/' + fileName);
|
||||||
if (fi.isFile())
|
if (fi.isFile())
|
||||||
|
@ -2193,7 +2193,7 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
|
|||||||
if (found.isEmpty()) {
|
if (found.isEmpty()) {
|
||||||
const char *testObjectName = QTestResult::currentTestObjectName();
|
const char *testObjectName = QTestResult::currentTestObjectName();
|
||||||
if (testObjectName) {
|
if (testObjectName) {
|
||||||
const QString testsPath = QLibraryInfo::location(QLibraryInfo::TestsPath);
|
const QString testsPath = QLibraryInfo::path(QLibraryInfo::TestsPath);
|
||||||
const QString candidate = QString::fromLatin1("%1/%2/%3")
|
const QString candidate = QString::fromLatin1("%1/%2/%3")
|
||||||
.arg(testsPath, QFile::decodeName(testObjectName).toLower(), base);
|
.arg(testsPath, QFile::decodeName(testObjectName).toLower(), base);
|
||||||
if (QFileInfo::exists(candidate)) {
|
if (QFileInfo::exists(candidate)) {
|
||||||
|
@ -590,7 +590,7 @@ namespace QTest {
|
|||||||
<< QLatin1String("project.pro");
|
<< QLatin1String("project.pro");
|
||||||
qmake.setWorkingDirectory(temporaryDirPath);
|
qmake.setWorkingDirectory(temporaryDirPath);
|
||||||
|
|
||||||
QString cmd = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmake";
|
QString cmd = QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmake";
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
cmd.append(".exe");
|
cmd.append(".exe");
|
||||||
#endif
|
#endif
|
||||||
|
@ -592,7 +592,7 @@ void tst_QUndoGroup::commandTextFormat()
|
|||||||
#if !QT_CONFIG(process)
|
#if !QT_CONFIG(process)
|
||||||
QSKIP("No QProcess available");
|
QSKIP("No QProcess available");
|
||||||
#else
|
#else
|
||||||
QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath);
|
QString binDir = QLibraryInfo::path(QLibraryInfo::BinariesPath);
|
||||||
|
|
||||||
if (QProcess::execute(binDir + "/lrelease -version") != 0)
|
if (QProcess::execute(binDir + "/lrelease -version") != 0)
|
||||||
QSKIP("lrelease is missing or broken");
|
QSKIP("lrelease is missing or broken");
|
||||||
|
@ -3856,7 +3856,7 @@ void tst_QUndoStack::commandTextFormat()
|
|||||||
#if !QT_CONFIG(process)
|
#if !QT_CONFIG(process)
|
||||||
QSKIP("No QProcess available");
|
QSKIP("No QProcess available");
|
||||||
#else
|
#else
|
||||||
QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath);
|
QString binDir = QLibraryInfo::path(QLibraryInfo::BinariesPath);
|
||||||
|
|
||||||
if (QProcess::execute(binDir + "/lrelease -version") != 0)
|
if (QProcess::execute(binDir + "/lrelease -version") != 0)
|
||||||
QSKIP("lrelease is missing or broken");
|
QSKIP("lrelease is missing or broken");
|
||||||
|
@ -56,7 +56,7 @@ void FindTestData::initTestCase()
|
|||||||
+ "/tests";
|
+ "/tests";
|
||||||
QVERIFY(QDir("/").mkpath(install_path));
|
QVERIFY(QDir("/").mkpath(install_path));
|
||||||
QVERIFY(QDir("/").mkpath(install_path + "/findtestdata"));
|
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
|
// make fake source and build directories
|
||||||
QVERIFY(QDir("/").mkpath(app_path + "/fakesrc"));
|
QVERIFY(QDir("/").mkpath(app_path + "/fakesrc"));
|
||||||
|
@ -772,7 +772,7 @@ private:
|
|||||||
|
|
||||||
void tst_Moc::initTestCase()
|
void tst_Moc::initTestCase()
|
||||||
{
|
{
|
||||||
QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
|
QString binpath = QLibraryInfo::path(QLibraryInfo::BinariesPath);
|
||||||
QString qmake = QString("%1/qmake").arg(binpath);
|
QString qmake = QString("%1/qmake").arg(binpath);
|
||||||
m_moc = QString("%1/moc").arg(binpath);
|
m_moc = QString("%1/moc").arg(binpath);
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ void tst_qdbuscpp2xml::qdbuscpp2xml()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Launch
|
// Launch
|
||||||
const QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
|
const QString binpath = QLibraryInfo::path(QLibraryInfo::BinariesPath);
|
||||||
const QString command = binpath + QLatin1String("/qdbuscpp2xml");
|
const QString command = binpath + QLatin1String("/qdbuscpp2xml");
|
||||||
QProcess process;
|
QProcess process;
|
||||||
process.start(command, QStringList() << options << (QFINDTESTDATA(inputfile + QStringLiteral(".h"))));
|
process.start(command, QStringList() << options << (QFINDTESTDATA(inputfile + QStringLiteral(".h"))));
|
||||||
|
@ -218,7 +218,7 @@ void tst_qdbusxml2cpp::process()
|
|||||||
QFETCH_GLOBAL(QString, commandLineArg);
|
QFETCH_GLOBAL(QString, commandLineArg);
|
||||||
|
|
||||||
// Run the tool
|
// Run the tool
|
||||||
const QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
|
const QString binpath = QLibraryInfo::path(QLibraryInfo::BinariesPath);
|
||||||
const QString command = binpath + QLatin1String("/qdbusxml2cpp");
|
const QString command = binpath + QLatin1String("/qdbusxml2cpp");
|
||||||
QProcess process;
|
QProcess process;
|
||||||
process.start(command, QStringList() << commandLineArg << "-" << "-N");
|
process.start(command, QStringList() << commandLineArg << "-" << "-N");
|
||||||
|
@ -117,7 +117,7 @@ static void copyDir(const QString &sourceDirPath, const QString &targetDirPath)
|
|||||||
void tst_qmake::initTestCase()
|
void tst_qmake::initTestCase()
|
||||||
{
|
{
|
||||||
QVERIFY2(tempWorkDir.isValid(), qPrintable(tempWorkDir.errorString()));
|
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);
|
QString cmd = QString("%1/qmake").arg(binpath);
|
||||||
#ifdef Q_CC_MSVC
|
#ifdef Q_CC_MSVC
|
||||||
const QString jom = QStandardPaths::findExecutable(QLatin1String("jom.exe"));
|
const QString jom = QStandardPaths::findExecutable(QLatin1String("jom.exe"));
|
||||||
@ -656,7 +656,7 @@ void tst_qmake::qinstall()
|
|||||||
|
|
||||||
// install an executable file
|
// install an executable file
|
||||||
{
|
{
|
||||||
const QString mocFilePath = QLibraryInfo::location(QLibraryInfo::BinariesPath)
|
const QString mocFilePath = QLibraryInfo::path(QLibraryInfo::BinariesPath)
|
||||||
+ "/moc"
|
+ "/moc"
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
+ ".exe"
|
+ ".exe"
|
||||||
|
@ -103,7 +103,7 @@ private:
|
|||||||
|
|
||||||
void tst_rcc::initTestCase()
|
void tst_rcc::initTestCase()
|
||||||
{
|
{
|
||||||
m_rcc = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/rcc");
|
m_rcc = QLibraryInfo::path(QLibraryInfo::BinariesPath) + QLatin1String("/rcc");
|
||||||
|
|
||||||
m_dataPath = QFINDTESTDATA("data");
|
m_dataPath = QFINDTESTDATA("data");
|
||||||
QVERIFY(!m_dataPath.isEmpty());
|
QVERIFY(!m_dataPath.isEmpty());
|
||||||
|
@ -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})";
|
R"([*#][*#] Created by: Qt User Interface Compiler version \d{1,2}\.\d{1,2}\.\d{1,2})";
|
||||||
|
|
||||||
tst_uic::tst_uic()
|
tst_uic::tst_uic()
|
||||||
: m_command(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/uic"))
|
: m_command(QLibraryInfo::path(QLibraryInfo::BinariesPath) + QLatin1String("/uic"))
|
||||||
, m_versionRegexp(QLatin1String(versionRegexp))
|
, m_versionRegexp(QLatin1String(versionRegexp))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -911,7 +911,7 @@ void tst_QApplication::libraryPaths()
|
|||||||
int argc = 1;
|
int argc = 1;
|
||||||
QApplication app(argc, &argv0);
|
QApplication app(argc, &argv0);
|
||||||
QString appDirPath = QCoreApplication::applicationDirPath();
|
QString appDirPath = QCoreApplication::applicationDirPath();
|
||||||
QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
|
QString installPathPlugins = QLibraryInfo::path(QLibraryInfo::PluginsPath);
|
||||||
|
|
||||||
QStringList actual = QApplication::libraryPaths();
|
QStringList actual = QApplication::libraryPaths();
|
||||||
actual.sort();
|
actual.sort();
|
||||||
@ -939,7 +939,7 @@ void tst_QApplication::libraryPaths()
|
|||||||
// this test doesn't work if KDE 4 is installed
|
// this test doesn't work if KDE 4 is installed
|
||||||
QCOMPARE(count, 1); // before creating QApplication, only the PluginsPath is in the libraryPaths()
|
QCOMPARE(count, 1); // before creating QApplication, only the PluginsPath is in the libraryPaths()
|
||||||
#endif
|
#endif
|
||||||
QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
|
QString installPathPlugins = QLibraryInfo::path(QLibraryInfo::PluginsPath);
|
||||||
QApplication::addLibraryPath(installPathPlugins);
|
QApplication::addLibraryPath(installPathPlugins);
|
||||||
qCDebug(lcTests) << "installPathPlugins" << installPathPlugins;
|
qCDebug(lcTests) << "installPathPlugins" << installPathPlugins;
|
||||||
qCDebug(lcTests) << "After adding plugins path:" << QApplication::libraryPaths();
|
qCDebug(lcTests) << "After adding plugins path:" << QApplication::libraryPaths();
|
||||||
@ -963,7 +963,7 @@ void tst_QApplication::libraryPaths()
|
|||||||
|
|
||||||
qCDebug(lcTests) << "Initial library path:" << QCoreApplication::libraryPaths();
|
qCDebug(lcTests) << "Initial library path:" << QCoreApplication::libraryPaths();
|
||||||
int count = QCoreApplication::libraryPaths().count();
|
int count = QCoreApplication::libraryPaths().count();
|
||||||
QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
|
QString installPathPlugins = QLibraryInfo::path(QLibraryInfo::PluginsPath);
|
||||||
QCoreApplication::addLibraryPath(installPathPlugins);
|
QCoreApplication::addLibraryPath(installPathPlugins);
|
||||||
qCDebug(lcTests) << "installPathPlugins" << installPathPlugins;
|
qCDebug(lcTests) << "installPathPlugins" << installPathPlugins;
|
||||||
qCDebug(lcTests) << "After adding plugins path:" << QCoreApplication::libraryPaths();
|
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
|
// library path list should contain the default plus the one valid path
|
||||||
QStringList expected =
|
QStringList expected =
|
||||||
QStringList()
|
QStringList()
|
||||||
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
|
<< QLibraryInfo::path(QLibraryInfo::PluginsPath)
|
||||||
<< QDir(QCoreApplication::applicationDirPath()).canonicalPath()
|
<< QDir(QCoreApplication::applicationDirPath()).canonicalPath()
|
||||||
<< QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).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
|
// library path list should contain the default
|
||||||
QStringList expected =
|
QStringList expected =
|
||||||
QStringList()
|
QStringList()
|
||||||
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
|
<< QLibraryInfo::path(QLibraryInfo::PluginsPath)
|
||||||
<< QCoreApplication::applicationDirPath();
|
<< QCoreApplication::applicationDirPath();
|
||||||
QVERIFY(isPathListIncluded(QCoreApplication::libraryPaths(), expected));
|
QVERIFY(isPathListIncluded(QCoreApplication::libraryPaths(), expected));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user