Skip to content
Snippets Groups Projects
Commit 175b43ec authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Make default Qt version alrorithmn more strict

 * Add qWarnings on failures.
parent ecc25ff2
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QDebug>
#include <QtGui/QInputDialog> #include <QtGui/QInputDialog>
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
...@@ -125,28 +127,34 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map) ...@@ -125,28 +127,34 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
m_toolChainType = map.value(QLatin1String(TOOLCHAIN_KEY)).toInt(); m_toolChainType = map.value(QLatin1String(TOOLCHAIN_KEY)).toInt();
m_qmakeBuildConfiguration = QtVersion::QmakeBuildConfigs(map.value(QLatin1String(BUILD_CONFIGURATION_KEY)).toInt()); m_qmakeBuildConfiguration = QtVersion::QmakeBuildConfigs(map.value(QLatin1String(BUILD_CONFIGURATION_KEY)).toInt());
// Pick a decent Qt version if the default version is used: // Pick a Qt version if the default version is used:
// We assume that the default Qt version as used in earlier versions of Qt creator
// was supporting a desktop flavor of Qt.
if (m_qtVersionId == 0) { if (m_qtVersionId == 0) {
QList<QtVersion *> versions = QtVersionManager::instance()->versions(); QList<QtVersion *> versions = QtVersionManager::instance()->versions();
foreach (QtVersion *v, versions) { foreach (QtVersion *v, versions) {
if (v->isValid()) if (v->isValid() && v->supportsTargetId(QLatin1String(DESKTOP_TARGET_ID))) {
m_qtVersionId = v->uniqueId(); m_qtVersionId = v->uniqueId();
if (v->supportsTargetId(QLatin1String(DESKTOP_TARGET_ID)))
break; break;
}
} }
if (m_qtVersionId == 0) if (m_qtVersionId == 0)
m_qtVersionId = versions.at(0)->uniqueId(); m_qtVersionId = versions.at(0)->uniqueId();
} }
if (!qtVersion()->supportedTargetIds().contains(target()->id())) if (!qtVersion()->isValid() || !qtVersion()->supportedTargetIds().contains(target()->id())) {
qWarning() << "Buildconfiguration" << displayName() << ": Qt" << qtVersion()->displayName() << "not supported by target" << target()->id();
return false; return false;
}
QList<ToolChain::ToolChainType> possibleTcs(qt4Target()->filterToolChainTypes(qtVersion()->possibleToolChainTypes())); QList<ToolChain::ToolChainType> possibleTcs(qt4Target()->filterToolChainTypes(qtVersion()->possibleToolChainTypes()));
if (!possibleTcs.contains(toolChainType())) if (!possibleTcs.contains(toolChainType()))
setToolChainType(qt4Target()->preferredToolChainType(possibleTcs)); setToolChainType(qt4Target()->preferredToolChainType(possibleTcs));
if (toolChainType() == ToolChain::INVALID) if (toolChainType() == ToolChain::INVALID) {
qWarning() << "No toolchain available for" << qtVersion()->displayName() << "used in" << target()->id() << "!";
return false; return false;
}
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment