forked from qt-creator/qt-creator
Toolchain: Allow all tool chains
Allow all tool chains if either the Qt version is invalid or no Qt modules are not selected. Change-Id: I9842c30aca0a8752915548dc258f257c3fd39e4d Reviewed-on: http://codereview.qt-project.org/4990 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
971512b39c
commit
ffa88df344
@@ -188,6 +188,8 @@ void Qt4BuildConfiguration::ctor()
|
||||
this, SLOT(emitBuildDirectoryChanged()));
|
||||
connect(this, SIGNAL(environmentChanged()),
|
||||
this, SLOT(emitProFileEvaluateNeeded()));
|
||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
||||
this, SLOT(proFileUpdated()));
|
||||
|
||||
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
|
||||
connect(vm, SIGNAL(qtVersionsChanged(QList<int>)),
|
||||
@@ -202,6 +204,14 @@ void Qt4BuildConfiguration::emitBuildDirectoryChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void Qt4BuildConfiguration::proFileUpdated()
|
||||
{
|
||||
// Changing the included Qt modules from 0 to at least one might have caused the
|
||||
// tool chain to become invalid.
|
||||
if (!qt4Target()->possibleToolChains(this).contains(toolChain()))
|
||||
setToolChain(qt4Target()->preferredToolChain(this));
|
||||
}
|
||||
|
||||
Qt4BaseTarget *Qt4BuildConfiguration::qt4Target() const
|
||||
{
|
||||
return static_cast<Qt4BaseTarget *>(target());
|
||||
|
||||
@@ -146,6 +146,7 @@ signals:
|
||||
private slots:
|
||||
void qtVersionsChanged(const QList<int> &changedVersions);
|
||||
void emitBuildDirectoryChanged();
|
||||
void proFileUpdated();
|
||||
|
||||
protected:
|
||||
Qt4BuildConfiguration(Qt4BaseTarget *target, Qt4BuildConfiguration *source);
|
||||
|
||||
@@ -1836,6 +1836,7 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
|
||||
QLatin1String("QML_IMPORT_PATH"), m_projectDir);
|
||||
newVarValues[Makefile] = m_readerExact->values("MAKEFILE");
|
||||
newVarValues[SymbianCapabilities] = m_readerExact->values("TARGET.CAPABILITY");
|
||||
newVarValues[QtVar] = m_readerExact->values(QLatin1String("QT"));
|
||||
|
||||
m_isDeployable = false;
|
||||
if (m_projectType == ApplicationTemplate) {
|
||||
|
||||
@@ -87,6 +87,7 @@ enum Qt4Variable {
|
||||
PrecompiledHeaderVar,
|
||||
LibDirectoriesVar,
|
||||
ConfigVar,
|
||||
QtVar,
|
||||
QmlImportPathVar,
|
||||
Makefile,
|
||||
SymbianCapabilities
|
||||
|
||||
@@ -122,6 +122,9 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4BaseTarget *target)
|
||||
connect(target->qt4Project(), SIGNAL(buildDirectoryInitialized()),
|
||||
this, SLOT(updateImportLabel()));
|
||||
|
||||
connect(target->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
||||
this, SLOT(updateToolChainCombo()));
|
||||
|
||||
connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainsChanged()),
|
||||
this, SLOT(updateToolChainCombo()));
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "qmakestep.h"
|
||||
#include "qt4project.h"
|
||||
#include "qt4basetargetfactory.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4projectconfigwidget.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
@@ -263,9 +264,21 @@ QList<ProjectExplorer::ToolChain *> Qt4BaseTarget::possibleToolChains(ProjectExp
|
||||
QList<ProjectExplorer::ToolChain *> result;
|
||||
|
||||
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(bc);
|
||||
if (!qt4bc || !qt4bc->qtVersion() || !qt4bc->qtVersion()->isValid())
|
||||
if (!qt4bc || !qt4bc->qtVersion())
|
||||
return tmp;
|
||||
|
||||
QList<Qt4ProFileNode *> profiles = qt4Project()->allProFiles();
|
||||
bool qtUsed = false;
|
||||
foreach (Qt4ProFileNode *pro, profiles) {
|
||||
if (!pro->variableValue(QtVar).isEmpty()) {
|
||||
qtUsed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!qtUsed || !qt4bc->qtVersion()->isValid())
|
||||
return ProjectExplorer::ToolChainManager::instance()->toolChains();
|
||||
|
||||
QList<ProjectExplorer::Abi> abiList = qt4bc->qtVersion()->qtAbis();
|
||||
foreach (const ProjectExplorer::Abi &abi, abiList)
|
||||
tmp.append(ProjectExplorer::ToolChainManager::instance()->findToolChains(abi));
|
||||
|
||||
Reference in New Issue
Block a user