Commit 06de43a2 authored by Tobias Hunger's avatar Tobias Hunger

Kits: Mkspec will fix the ToolChain now if possible

Change-Id: I142063e7c1158f013b4e5005fa4263df0f025124
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 1bff9f82
......@@ -33,6 +33,7 @@
#include "qmakekitconfigwidget.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchainmanager.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h>
......@@ -83,6 +84,30 @@ QList<ProjectExplorer::Task> QmakeKitInformation::validate(const ProjectExplorer
return result;
}
void QmakeKitInformation::fix(ProjectExplorer::Kit *k)
{
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k);
if (!version)
return;
Utils::FileName spec = QmakeKitInformation::mkspec(k);
if (spec.isEmpty())
spec = version->mkspec();
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
if (!tc || !tc->suggestedMkspecList().contains(spec)) {
QList<ProjectExplorer::ToolChain *> tcList = ProjectExplorer::ToolChainManager::instance()->toolChains();
foreach (ProjectExplorer::ToolChain *current, tcList) {
if (version->qtAbis().contains(current->targetAbi())
&& current->suggestedMkspecList().contains(spec)) {
ProjectExplorer::ToolChainKitInformation::setToolChain(k, current);
break;
}
}
}
}
ProjectExplorer::KitConfigWidget *
QmakeKitInformation::createConfigWidget(ProjectExplorer::Kit *k) const
{
......
......@@ -50,6 +50,7 @@ public:
QVariant defaultValue(ProjectExplorer::Kit *k) const;
QList<ProjectExplorer::Task> validate(const ProjectExplorer::Kit *k) const;
void fix(ProjectExplorer::Kit *k);
ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const;
......
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