forked from qt-creator/qt-creator
Kits: Mkspec will fix the ToolChain now if possible
Change-Id: I142063e7c1158f013b4e5005fa4263df0f025124 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user