forked from qt-creator/qt-creator
make more use of BaseQtVersion::qmakeProperty()
... instead of peeking into versionInfo().
in fact, make versionInfo() private, to avoid subsequent deterioration
as happened before (after 5e596e89d).
some other functions that use it in its interface also become private.
this fixes several breakages related to working with non-installed
prefix builds of qt.
Change-Id: Ib67de79323c9e38f3de48a09854b155de9eef5b2
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
@@ -131,7 +131,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
|
||||
Kit *kit = target->kit();
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
|
||||
if (version) {
|
||||
const QString qmlQtDir = version->versionInfo().value(QLatin1String("QT_INSTALL_QML"));
|
||||
const QString qmlQtDir = version->qmakeProperty("QT_INSTALL_QML");
|
||||
params.additionalSearchDirectories = QStringList(qmlQtDir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,7 +584,7 @@ QmakeBuildInfo *QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
QString projectDirectory = projectFilePath.toFileInfo().absolutePath();
|
||||
QDir qtSourceDir = QDir(version->sourcePath().toString());
|
||||
QString relativeProjectPath = qtSourceDir.relativeFilePath(projectDirectory);
|
||||
QString qtBuildDir = version->versionInfo().value(QStringLiteral("QT_INSTALL_PREFIX"));
|
||||
QString qtBuildDir = version->qmakeProperty("QT_INSTALL_PREFIX");
|
||||
QString absoluteBuildPath = QDir::cleanPath(qtBuildDir + QLatin1Char('/') + relativeProjectPath);
|
||||
|
||||
info->buildDirectory = FileName::fromString(absoluteBuildPath);
|
||||
|
||||
@@ -819,7 +819,7 @@ QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFileNo
|
||||
|
||||
if (qtVersion && qtVersion->isValid()) {
|
||||
m_qmakeGlobals->qmake_abslocation = QDir::cleanPath(qtVersion->qmakeCommand().toString());
|
||||
m_qmakeGlobals->setProperties(qtVersion->versionInfo());
|
||||
qtVersion->applyProperties(m_qmakeGlobals);
|
||||
}
|
||||
m_qmakeGlobals->setDirectories(rootProjectNode()->sourceDir(), rootProjectNode()->buildDir());
|
||||
|
||||
|
||||
@@ -234,18 +234,17 @@ QList<DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles()
|
||||
QTC_ASSERT(qtVersion, return result);
|
||||
|
||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||
result.append(gatherFiles(qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS")),
|
||||
QString(), QStringList() << QLatin1String("*.so.?")));
|
||||
result.append(gatherFiles(qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS"))
|
||||
+ QLatin1String("/fonts")));
|
||||
result.append(gatherFiles(qtVersion->qmakeProperty("QT_INSTALL_LIBS"),
|
||||
QString(), QStringList() << QLatin1String("*.so.?")));
|
||||
result.append(gatherFiles(qtVersion->qmakeProperty("QT_INSTALL_LIBS")
|
||||
+ QLatin1String("/fonts")));
|
||||
} else {
|
||||
result.append(gatherFiles(
|
||||
qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS"))));
|
||||
result.append(gatherFiles(qtVersion->qmakeProperty("QT_INSTALL_LIBS")));
|
||||
}
|
||||
|
||||
result.append(gatherFiles(qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS"))));
|
||||
result.append(gatherFiles(qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_IMPORTS"))));
|
||||
result.append(gatherFiles(qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_QML"))));
|
||||
result.append(gatherFiles(qtVersion->qmakeProperty("QT_INSTALL_PLUGINS")));
|
||||
result.append(gatherFiles(qtVersion->qmakeProperty("QT_INSTALL_IMPORTS")));
|
||||
result.append(gatherFiles(qtVersion->qmakeProperty("QT_INSTALL_QML")));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ void QnxQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Enviro
|
||||
updateEnvironment();
|
||||
env.modify(m_qnxEnv);
|
||||
|
||||
env.prependOrSetLibrarySearchPath(versionInfo().value(QLatin1String("QT_INSTALL_LIBS")));
|
||||
env.prependOrSetLibrarySearchPath(qmakeProperty("QT_INSTALL_LIBS")); // FIXME: PropertyVariantDev
|
||||
}
|
||||
|
||||
Utils::Environment QnxQtVersion::qmakeRunEnvironment() const
|
||||
|
||||
@@ -71,17 +71,17 @@ QString QnxUtils::cpuDirShortDescription(const QString &cpuDir)
|
||||
|
||||
QStringList QnxUtils::searchPaths(QnxQtVersion *qtVersion)
|
||||
{
|
||||
const QDir pluginDir(qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS")));
|
||||
const QDir pluginDir(qtVersion->qmakeProperty("QT_INSTALL_PLUGINS"));
|
||||
const QStringList pluginSubDirs = pluginDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
|
||||
QStringList searchPaths;
|
||||
|
||||
Q_FOREACH (const QString &dir, pluginSubDirs) {
|
||||
searchPaths << qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS"))
|
||||
searchPaths << qtVersion->qmakeProperty("QT_INSTALL_PLUGINS")
|
||||
+ QLatin1Char('/') + dir;
|
||||
}
|
||||
|
||||
searchPaths << qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS"));
|
||||
searchPaths << qtVersion->qmakeProperty("QT_INSTALL_LIBS");
|
||||
searchPaths << qtVersion->qnxTarget() + QLatin1Char('/') + qtVersion->cpuDir()
|
||||
+ QLatin1String("/lib");
|
||||
searchPaths << qtVersion->qnxTarget() + QLatin1Char('/') + qtVersion->cpuDir()
|
||||
|
||||
@@ -1018,7 +1018,7 @@ void BaseQtVersion::ensureMkSpecParsed() const
|
||||
|
||||
QMakeVfs vfs;
|
||||
QMakeGlobals option;
|
||||
option.setProperties(versionInfo());
|
||||
applyProperties(&option);
|
||||
option.environment = qmakeRunEnvironment().toProcessEnvironment();
|
||||
ProMessageHandler msgHandler(true);
|
||||
ProFileCacheManager::instance()->incRefCount();
|
||||
@@ -1212,10 +1212,15 @@ QString BaseQtVersion::qmakeProperty(const QHash<QString,QString> &versionInfo,
|
||||
return versionInfo.value(QString::fromLatin1(name));
|
||||
}
|
||||
|
||||
QString BaseQtVersion::qmakeProperty(const QByteArray &name) const
|
||||
QString BaseQtVersion::qmakeProperty(const QByteArray &name, PropertyVariant variant) const
|
||||
{
|
||||
updateVersionInfo();
|
||||
return qmakeProperty(m_versionInfo, name);
|
||||
return qmakeProperty(m_versionInfo, name, variant);
|
||||
}
|
||||
|
||||
void BaseQtVersion::applyProperties(QMakeGlobals *qmakeGlobals) const
|
||||
{
|
||||
qmakeGlobals->setProperties(versionInfo());
|
||||
}
|
||||
|
||||
bool BaseQtVersion::hasDocumentation() const
|
||||
|
||||
@@ -49,6 +49,7 @@ class Task;
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class ProFileEvaluator;
|
||||
class QMakeGlobals;
|
||||
class QSettings;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -119,10 +120,10 @@ public:
|
||||
QList<ProjectExplorer::Abi> qtAbis() const;
|
||||
virtual QList<ProjectExplorer::Abi> detectQtAbis() const = 0;
|
||||
|
||||
// Returns the PREFIX, BINPREFIX, DOCPREFIX and similar information
|
||||
QHash<QString,QString> versionInfo() const;
|
||||
enum PropertyVariant { PropertyVariantGet, PropertyVariantSrc };
|
||||
QString qmakeProperty(const QByteArray &name) const;
|
||||
QString qmakeProperty(const QByteArray &name,
|
||||
PropertyVariant variant = PropertyVariantGet) const;
|
||||
void applyProperties(QMakeGlobals *qmakeGlobals) const;
|
||||
virtual void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const;
|
||||
virtual Utils::Environment qmakeRunEnvironment() const;
|
||||
|
||||
@@ -181,12 +182,6 @@ public:
|
||||
/// warnings and finally info items.
|
||||
QList<ProjectExplorer::Task> reportIssues(const QString &proFile, const QString &buildDir) const;
|
||||
|
||||
static bool queryQMakeVariables(const Utils::FileName &binary, const Utils::Environment &env,
|
||||
QHash<QString, QString> *versionInfo, QString *error = 0);
|
||||
static Utils::FileName mkspecDirectoryFromVersionInfo(const QHash<QString, QString> &versionInfo);
|
||||
static Utils::FileName mkspecFromVersionInfo(const QHash<QString, QString> &versionInfo);
|
||||
static Utils::FileName sourcePath(const QHash<QString, QString> &versionInfo);
|
||||
|
||||
static bool isQmlDebuggingSupported(ProjectExplorer::Kit *k, QString *reason = 0);
|
||||
bool isQmlDebuggingSupported(QString *reason = 0) const;
|
||||
static bool isQtQuickCompilerSupported(ProjectExplorer::Kit *k, QString *reason = 0);
|
||||
@@ -232,9 +227,6 @@ protected:
|
||||
BaseQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
BaseQtVersion(const BaseQtVersion &other);
|
||||
|
||||
static QString qmakeProperty(const QHash<QString,QString> &versionInfo, const QByteArray &name,
|
||||
PropertyVariant variant = PropertyVariantGet);
|
||||
|
||||
virtual QList<ProjectExplorer::Task> reportIssuesImpl(const QString &proFile, const QString &buildDir) const;
|
||||
|
||||
// helper function for desktop and simulator to figure out the supported abis based on the libraries
|
||||
@@ -254,6 +246,14 @@ private:
|
||||
enum Binaries { QmlViewer, QmlScene, Designer, Linguist, Uic, QScxmlc };
|
||||
QString findQtBinary(Binaries binary) const;
|
||||
void updateMkspec() const;
|
||||
QHash<QString,QString> versionInfo() const;
|
||||
static bool queryQMakeVariables(const Utils::FileName &binary, const Utils::Environment &env,
|
||||
QHash<QString, QString> *versionInfo, QString *error = 0);
|
||||
static QString qmakeProperty(const QHash<QString,QString> &versionInfo, const QByteArray &name,
|
||||
PropertyVariant variant = PropertyVariantGet);
|
||||
static Utils::FileName mkspecDirectoryFromVersionInfo(const QHash<QString, QString> &versionInfo);
|
||||
static Utils::FileName mkspecFromVersionInfo(const QHash<QString, QString> &versionInfo);
|
||||
static Utils::FileName sourcePath(const QHash<QString, QString> &versionInfo);
|
||||
void setId(int id); // used by the qtversionmanager for legacy restore
|
||||
// and by the qtoptionspage to replace Qt versions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user