Commit ac28279e authored by dt's avatar dt
Browse files

TargetSetupPage: Only offer qt versions that have a toolchain

Task-Nr: QTCREATORBUG-3886
parent 11311b6e
......@@ -136,7 +136,7 @@ QList<BuildConfigurationInfo> Qt4DesktopTargetFactory::availableBuildConfigurati
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid())
if (!version->isValid() || !version->toolChainAvailable())
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
......
......@@ -136,7 +136,7 @@ QList<BuildConfigurationInfo> Qt4SimulatorTargetFactory::availableBuildConfigura
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid())
if (!version->isValid() || !version->toolChainAvailable())
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), id);
......
......@@ -156,7 +156,7 @@ QList<BuildConfigurationInfo> Qt4MaemoTargetFactory::availableBuildConfiguration
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid())
if (!version->isValid() || !version->toolChainAvailable())
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), id);
......
......@@ -45,6 +45,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/toolchainmanager.h>
using ProjectExplorer::idFromMap;
using namespace Qt4ProjectManager;
......@@ -139,8 +140,9 @@ QList<BuildConfigurationInfo> Qt4SymbianTargetFactory::availableBuildConfigurati
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid())
if (!version->isValid() || !version->toolChainAvailable())
continue;
bool buildAll = version->defaultBuildConfig() & QtVersion::BuildAll;
QtVersion::QmakeBuildConfigs config = buildAll ? QtVersion::BuildAll : QtVersion::QmakeBuildConfig(0);
QString dir = QFileInfo(proFilePath).absolutePath(), id;
......
......@@ -254,10 +254,10 @@ void QtVersionManager::removeVersion(QtVersion *version)
bool QtVersionManager::supportsTargetId(const QString &id) const
{
foreach (QtVersion *version, m_versions) {
if (version->supportsTargetId(id))
QList<QtVersion *> versions = QtVersionManager::instance()->versionsForTargetId(id);
foreach (QtVersion *v, versions)
if (v->isValid() && v->toolChainAvailable())
return true;
}
return false;
}
......@@ -1750,6 +1750,16 @@ bool QtVersion::isValid() const
&& !m_abis.isEmpty();
}
bool QtVersion::toolChainAvailable() const
{
if (!isValid())
return false;
foreach (const ProjectExplorer::Abi &abi, qtAbis())
if (!ProjectExplorer::ToolChainManager::instance()->findToolChains(abi).isEmpty())
return true;
return false;
}
QString QtVersion::invalidReason() const
{
if (isValid())
......
......@@ -95,7 +95,8 @@ public:
QtVersion();
~QtVersion();
bool isValid() const; //TOOD check that the dir exists and the name is non empty
bool isValid() const;
bool toolChainAvailable() const;
QString invalidReason() const;
QString description() const;
bool isAutodetected() const { return m_isAutodetected; }
......
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