Commit b9251a66 authored by dt's avatar dt
Browse files

Fix available QtVersion::availableToolchains

Do really disable the symbian emulator if there's no toolchain
supporting it.

Reviewed-By: hunger
parent 7d431188
......@@ -135,7 +135,7 @@ QList<BuildConfigurationInfo> Qt4DesktopTargetFactory::availableBuildConfigurati
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid() || !version->toolChainAvailable())
if (!version->isValid() || !version->toolChainAvailable(id))
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
......
......@@ -135,7 +135,7 @@ QList<BuildConfigurationInfo> Qt4SimulatorTargetFactory::availableBuildConfigura
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid() || !version->toolChainAvailable())
if (!version->isValid() || !version->toolChainAvailable(id))
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), id);
......
......@@ -155,7 +155,7 @@ QList<BuildConfigurationInfo> Qt4MaemoTargetFactory::availableBuildConfiguration
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid() || !version->toolChainAvailable())
if (!version->isValid() || !version->toolChainAvailable(id))
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
#ifdef Q_OS_WIN
......
......@@ -78,6 +78,7 @@ QStringList Qt4SymbianTargetFactory::supportedTargetIds(ProjectExplorer::Project
return QStringList();
QStringList ids;
// The QtVersionManager will just check whether theres
if (QtVersionManager::instance()->supportsTargetId(Constants::S60_DEVICE_TARGET_ID))
ids << QLatin1String(Constants::S60_DEVICE_TARGET_ID);
if (QtVersionManager::instance()->supportsTargetId(Constants::S60_EMULATOR_TARGET_ID))
......@@ -168,7 +169,7 @@ QList<BuildConfigurationInfo> Qt4SymbianTargetFactory::availableBuildConfigurati
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid() || !version->toolChainAvailable())
if (!version->isValid() || !version->toolChainAvailable(id))
continue;
bool buildAll = version->defaultBuildConfig() & QtVersion::BuildAll;
......
......@@ -247,7 +247,7 @@ bool QtVersionManager::supportsTargetId(const QString &id) const
{
QList<QtVersion *> versions = QtVersionManager::instance()->versionsForTargetId(id);
foreach (QtVersion *v, versions)
if (v->isValid() && v->toolChainAvailable())
if (v->isValid() && v->toolChainAvailable(id))
return true;
return false;
}
......@@ -1815,10 +1815,29 @@ bool QtVersion::isValid() const
&& m_validSystemRoot;
}
bool QtVersion::toolChainAvailable() const
bool QtVersion::toolChainAvailable(const QString &id) const
{
if (!isValid())
return false;
if (id == QLatin1String(Constants::S60_EMULATOR_TARGET_ID)) {
QList<ProjectExplorer::ToolChain *> tcList =
ProjectExplorer::ToolChainManager::instance()->toolChains();
foreach (ProjectExplorer::ToolChain *tc, tcList) {
if (tc->id().startsWith(QLatin1String(Constants::WINSCW_TOOLCHAIN_ID)))
return true;
}
return false;
} else if (id == QLatin1String(Constants::S60_DEVICE_TARGET_ID)) {
QList<ProjectExplorer::ToolChain *> tcList =
ProjectExplorer::ToolChainManager::instance()->toolChains();
foreach (ProjectExplorer::ToolChain *tc, tcList) {
if (!tc->id().startsWith(Qt4ProjectManager::Constants::WINSCW_TOOLCHAIN_ID))
return true;
}
return false;
}
foreach (const ProjectExplorer::Abi &abi, qtAbis())
if (!ProjectExplorer::ToolChainManager::instance()->findToolChains(abi).isEmpty())
return true;
......
......@@ -96,7 +96,7 @@ public:
~QtVersion();
bool isValid() const;
bool toolChainAvailable() const;
bool toolChainAvailable(const QString &id) const;
QString invalidReason() const;
QString description() const;
......
Supports Markdown
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