Use QUuids to identify tool chains

Save/Restore has been updated to reflect this:

We now save manual as well as auto-detected tool chains into the user
toolChains.xml file.

When loading we load the SDK as well as the user toolChains.xml files.
We then do a autodetection run. All the tool chains restored that are
marked up as auto-detected are then checked again:
 * the tool chain was autodetected again: Throw away the newly auto-
   detected tool chain and reuse the saved one. This makes sure we
   keep the QUuid that is now part of the tool chains id.
 * the tool chain was not autodetected again: Throw away the saved
   tool chain.
 * the tool chain was newly autodetected: Add the new tool chain

We keep the old id around in the legacyId() method. It is used when
loading old .user files only. So there is no need to implement this
method for new tool chains.

Task-number: QTCREATORBUG-6702

Change-Id: Ifc0a216e5351a8a57db03615ba329e355e7d5f59
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Tobias Hunger
2011-12-19 12:06:44 +01:00
parent 97496df1bf
commit 52b47364de
20 changed files with 156 additions and 113 deletions

View File

@@ -133,7 +133,6 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
m_shadowBuild = map.value(QLatin1String(USE_SHADOW_BUILD_KEY), true).toBool();
m_qtVersionId = map.value(QLatin1String(QT_VERSION_ID_KEY)).toInt();
ProjectExplorer::ToolChain *tc = toolChain();
m_qmakeBuildConfiguration = QtSupport::BaseQtVersion::QmakeBuildConfigs(map.value(QLatin1String(BUILD_CONFIGURATION_KEY)).toInt());
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY), defaultShadowBuildDirectory()).toString();
@@ -160,6 +159,7 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
m_lastEmmitedBuildDirectory = buildDirectory();
ProjectExplorer::ToolChain *tc = toolChain();
if (version && version->isValid()) {
if (tc && !qt4Target()->possibleToolChains(this).contains(tc))
setToolChain(0);
@@ -377,7 +377,7 @@ void Qt4BuildConfiguration::setQtVersion(QtSupport::BaseQtVersion *version)
void Qt4BuildConfiguration::setToolChain(ProjectExplorer::ToolChain *tc)
{
if (tc != 0 && !qt4Target()->possibleToolChains(this).contains(tc))
if (tc != 0 && m_qtVersionId > 0 && !qt4Target()->possibleToolChains(this).contains(tc))
return;
if (toolChain() == tc)