Commit ffa88df3 authored by Tobias Hunger's avatar Tobias Hunger Committed by Tobias Hunger
Browse files

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: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 971512b3
......@@ -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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment