ProjectExplorer: Fix language for previously auto-detected toolchains

Change-Id: I02138a07d45a2169b9d667a56fc88e3f11db942a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Orgad Shaneh
2017-05-26 16:53:09 +03:00
committed by Orgad Shaneh
parent d3e4ef5868
commit 1e1253b5a7
2 changed files with 7 additions and 2 deletions

View File

@@ -972,8 +972,13 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains(const QString &comp
return tc->typeId() == requiredTypeId return tc->typeId() == requiredTypeId
&& tc->compilerCommand() == compilerPath; && tc->compilerCommand() == compilerPath;
}); });
if (!result.isEmpty()) if (!result.isEmpty()) {
for (ToolChain *tc : result) {
if (tc->isAutoDetected())
tc->setLanguage(language);
}
return result; return result;
}
result = autoDetectToolChain(compilerPath, language, requiredAbi); result = autoDetectToolChain(compilerPath, language, requiredAbi);

View File

@@ -133,7 +133,7 @@ ToolChain::ToolChain(const ToolChain &other) :
void ToolChain::setLanguage(Core::Id language) void ToolChain::setLanguage(Core::Id language)
{ {
QTC_ASSERT(!d->m_language.isValid(), return); QTC_ASSERT(!d->m_language.isValid() || isAutoDetected(), return);
QTC_ASSERT(language.isValid(), return); QTC_ASSERT(language.isValid(), return);
QTC_ASSERT(ToolChainManager::isLanguageSupported(language), return); QTC_ASSERT(ToolChainManager::isLanguageSupported(language), return);