forked from qt-creator/qt-creator
Clean up QmakeProjectImporter
Mostly namespaces, an unused variable, ... Change-Id: Ia2b879873eae7cb25f796f6bcf18b10bf3de1ff6 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -50,47 +50,49 @@
|
|||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
#include <QMessageBox>
|
using namespace ProjectExplorer;
|
||||||
|
using namespace QtSupport;
|
||||||
static const Core::Id QT_IS_TEMPORARY("Qmake.TempQt");
|
using namespace Utils;
|
||||||
|
|
||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
const Core::Id QT_IS_TEMPORARY("Qmake.TempQt");
|
||||||
|
|
||||||
QmakeProjectImporter::QmakeProjectImporter(const QString &path) :
|
QmakeProjectImporter::QmakeProjectImporter(const QString &path) :
|
||||||
ProjectExplorer::ProjectImporter(path)
|
ProjectImporter(path)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo *> QmakeProjectImporter::import(const Utils::FileName &importPath,
|
QList<BuildInfo *> QmakeProjectImporter::import(const FileName &importPath, bool silent)
|
||||||
bool silent)
|
|
||||||
{
|
{
|
||||||
QList<ProjectExplorer::BuildInfo *> result;
|
QList<BuildInfo *> result;
|
||||||
QFileInfo fi = importPath.toFileInfo();
|
QFileInfo fi = importPath.toFileInfo();
|
||||||
if (!fi.exists() && !fi.isDir())
|
if (!fi.exists() && !fi.isDir())
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
QStringList makefiles = QDir(importPath.toString()).entryList(QStringList(QLatin1String("Makefile*")));
|
QStringList makefiles = QDir(importPath.toString()).entryList(QStringList(QLatin1String("Makefile*")));
|
||||||
|
|
||||||
QtSupport::BaseQtVersion *version = 0;
|
BaseQtVersion *version = 0;
|
||||||
bool temporaryVersion = false;
|
bool temporaryVersion = false;
|
||||||
|
|
||||||
foreach (const QString &file, makefiles) {
|
foreach (const QString &file, makefiles) {
|
||||||
// find interesting makefiles
|
// find interesting makefiles
|
||||||
QString makefile = importPath.toString() + QLatin1Char('/') + file;
|
QString makefile = importPath.toString() + QLatin1Char('/') + file;
|
||||||
Utils::FileName qmakeBinary = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
|
FileName qmakeBinary = QtVersionManager::findQMakeBinaryFromMakefile(makefile);
|
||||||
QFileInfo qmakeFi = qmakeBinary.toFileInfo();
|
QFileInfo qmakeFi = qmakeBinary.toFileInfo();
|
||||||
Utils::FileName canonicalQmakeBinary = Utils::FileName::fromString(qmakeFi.canonicalFilePath());
|
FileName canonicalQmakeBinary = FileName::fromString(qmakeFi.canonicalFilePath());
|
||||||
if (canonicalQmakeBinary.isEmpty())
|
if (canonicalQmakeBinary.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
if (QtSupport::QtVersionManager::makefileIsFor(makefile, projectFilePath()) != QtSupport::QtVersionManager::SameProject)
|
if (QtVersionManager::makefileIsFor(makefile, projectFilePath()) != QtVersionManager::SameProject)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Find version:
|
// Find version:
|
||||||
foreach (QtSupport::BaseQtVersion *v, QtSupport::QtVersionManager::versions()) {
|
foreach (BaseQtVersion *v, QtVersionManager::versions()) {
|
||||||
QFileInfo vfi = v->qmakeCommand().toFileInfo();
|
QFileInfo vfi = v->qmakeCommand().toFileInfo();
|
||||||
Utils::FileName current = Utils::FileName::fromString(vfi.canonicalFilePath());
|
FileName current = FileName::fromString(vfi.canonicalFilePath());
|
||||||
if (current == canonicalQmakeBinary) {
|
if (current == canonicalQmakeBinary) {
|
||||||
version = v;
|
version = v;
|
||||||
break;
|
break;
|
||||||
@@ -100,48 +102,48 @@ QList<ProjectExplorer::BuildInfo *> QmakeProjectImporter::import(const Utils::Fi
|
|||||||
if (version) {
|
if (version) {
|
||||||
// Check if version is a temporary qt
|
// Check if version is a temporary qt
|
||||||
int qtId = version->uniqueId();
|
int qtId = version->uniqueId();
|
||||||
temporaryVersion = Utils::anyOf(ProjectExplorer::KitManager::kits(), [&qtId](ProjectExplorer::Kit *k){
|
temporaryVersion = Utils::anyOf(KitManager::kits(), [&qtId](Kit *k){
|
||||||
return k->value(QT_IS_TEMPORARY, -1).toInt() == qtId;
|
return k->value(QT_IS_TEMPORARY, -1).toInt() == qtId;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Create a new version if not found:
|
// Create a new version if not found:
|
||||||
// Do not use the canonical path here...
|
// Do not use the canonical path here...
|
||||||
version = QtSupport::QtVersionFactory::createQtVersionFromQMakePath(qmakeBinary);
|
version = QtVersionFactory::createQtVersionFromQMakePath(qmakeBinary);
|
||||||
if (!version)
|
if (!version)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool oldIsUpdating = setIsUpdating(true);
|
bool oldIsUpdating = setIsUpdating(true);
|
||||||
QtSupport::QtVersionManager::addVersion(version);
|
QtVersionManager::addVersion(version);
|
||||||
setIsUpdating(oldIsUpdating);
|
setIsUpdating(oldIsUpdating);
|
||||||
temporaryVersion = true;
|
temporaryVersion = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// find qmake arguments and mkspec
|
// find qmake arguments and mkspec
|
||||||
QPair<QtSupport::BaseQtVersion::QmakeBuildConfigs, QString> makefileBuildConfig =
|
QPair<BaseQtVersion::QmakeBuildConfigs, QString> makefileBuildConfig =
|
||||||
QtSupport::QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig());
|
QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig());
|
||||||
|
|
||||||
QString additionalArguments = makefileBuildConfig.second;
|
QString additionalArguments = makefileBuildConfig.second;
|
||||||
Utils::FileName parsedSpec =
|
FileName parsedSpec =
|
||||||
QmakeBuildConfiguration::extractSpecFromArguments(&additionalArguments, importPath.toString(), version);
|
QmakeBuildConfiguration::extractSpecFromArguments(&additionalArguments, importPath.toString(), version);
|
||||||
QStringList deducedArguments =
|
QStringList deducedArguments =
|
||||||
QmakeBuildConfiguration::extractDeducedArguments(&additionalArguments);
|
QmakeBuildConfiguration::extractDeducedArguments(&additionalArguments);
|
||||||
|
|
||||||
Utils::FileName versionSpec = version->mkspec();
|
FileName versionSpec = version->mkspec();
|
||||||
if (parsedSpec.isEmpty() || parsedSpec == Utils::FileName::fromLatin1("default"))
|
if (parsedSpec.isEmpty() || parsedSpec == FileName::fromLatin1("default"))
|
||||||
parsedSpec = versionSpec;
|
parsedSpec = versionSpec;
|
||||||
|
|
||||||
QString specArgument;
|
QString specArgument;
|
||||||
// Compare mkspecs and add to additional arguments
|
// Compare mkspecs and add to additional arguments
|
||||||
if (parsedSpec != versionSpec)
|
if (parsedSpec != versionSpec)
|
||||||
specArgument = QLatin1String("-spec ") + Utils::QtcProcess::quoteArg(parsedSpec.toUserOutput());
|
specArgument = QLatin1String("-spec ") + QtcProcess::quoteArg(parsedSpec.toUserOutput());
|
||||||
Utils::QtcProcess::addArgs(&specArgument, additionalArguments);
|
QtcProcess::addArgs(&specArgument, additionalArguments);
|
||||||
|
|
||||||
// Find kits (can be more than one, e.g. (Linux-)Desktop and embedded linux):
|
// Find kits (can be more than one, e.g. (Linux-)Desktop and embedded linux):
|
||||||
QList<ProjectExplorer::Kit *> kitList;
|
QList<Kit *> kitList = KitManager::kits();
|
||||||
foreach (ProjectExplorer::Kit *k, ProjectExplorer::KitManager::kits()) {
|
foreach (Kit *k, kitList) {
|
||||||
QtSupport::BaseQtVersion *kitVersion = QtSupport::QtKitInformation::qtVersion(k);
|
BaseQtVersion *kitVersion = QtKitInformation::qtVersion(k);
|
||||||
Utils::FileName kitSpec = QmakeKitInformation::mkspec(k);
|
FileName kitSpec = QmakeKitInformation::mkspec(k);
|
||||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
|
ToolChain *tc = ToolChainKitInformation::toolChain(k);
|
||||||
if (kitSpec.isEmpty() && kitVersion)
|
if (kitSpec.isEmpty() && kitVersion)
|
||||||
kitSpec = kitVersion->mkspecFor(tc);
|
kitSpec = kitVersion->mkspecFor(tc);
|
||||||
QStringList kitDeducedArguments;
|
QStringList kitDeducedArguments;
|
||||||
@@ -156,32 +158,31 @@ QList<ProjectExplorer::BuildInfo *> QmakeProjectImporter::import(const Utils::Fi
|
|||||||
if (kitList.isEmpty())
|
if (kitList.isEmpty())
|
||||||
kitList.append(createTemporaryKit(version, temporaryVersion, parsedSpec, deducedArguments));
|
kitList.append(createTemporaryKit(version, temporaryVersion, parsedSpec, deducedArguments));
|
||||||
|
|
||||||
foreach (ProjectExplorer::Kit *k, kitList) {
|
foreach (Kit *k, kitList) {
|
||||||
addProject(k);
|
addProject(k);
|
||||||
|
|
||||||
QmakeBuildConfigurationFactory *factory
|
auto factory = qobject_cast<QmakeBuildConfigurationFactory *>(
|
||||||
= qobject_cast<QmakeBuildConfigurationFactory *>(
|
IBuildConfigurationFactory::find(k, projectFilePath()));
|
||||||
ProjectExplorer::IBuildConfigurationFactory::find(k, projectFilePath()));
|
|
||||||
|
|
||||||
if (!factory)
|
if (!factory)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// create info:
|
// create info:
|
||||||
QmakeBuildInfo *info = new QmakeBuildInfo(factory);
|
QmakeBuildInfo *info = new QmakeBuildInfo(factory);
|
||||||
if (makefileBuildConfig.first & QtSupport::BaseQtVersion::DebugBuild) {
|
if (makefileBuildConfig.first & BaseQtVersion::DebugBuild) {
|
||||||
info->type = ProjectExplorer::BuildConfiguration::Debug;
|
info->type = BuildConfiguration::Debug;
|
||||||
info->displayName = QCoreApplication::translate("QmakeProjectManager::Internal::QmakeProjectImporter", "Debug");
|
info->displayName = QCoreApplication::translate("QmakeProjectManager::Internal::QmakeProjectImporter", "Debug");
|
||||||
} else {
|
} else {
|
||||||
info->type = ProjectExplorer::BuildConfiguration::Release;
|
info->type = BuildConfiguration::Release;
|
||||||
info->displayName = QCoreApplication::translate("QmakeProjectManager::Internal::QmakeProjectImporter", "Release");
|
info->displayName = QCoreApplication::translate("QmakeProjectManager::Internal::QmakeProjectImporter", "Release");
|
||||||
}
|
}
|
||||||
info->kitId = k->id();
|
info->kitId = k->id();
|
||||||
info->buildDirectory = Utils::FileName::fromString(fi.absoluteFilePath());
|
info->buildDirectory = FileName::fromString(fi.absoluteFilePath());
|
||||||
info->additionalArguments = additionalArguments;
|
info->additionalArguments = additionalArguments;
|
||||||
info->makefile = makefile;
|
info->makefile = makefile;
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach (ProjectExplorer::BuildInfo *bInfo, result) {
|
foreach (BuildInfo *bInfo, result) {
|
||||||
if (*static_cast<QmakeBuildInfo *>(bInfo) == *info) {
|
if (*static_cast<QmakeBuildInfo *>(bInfo) == *info) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
@@ -203,7 +204,7 @@ QList<ProjectExplorer::BuildInfo *> QmakeProjectImporter::import(const Utils::Fi
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QmakeProjectImporter::importCandidates(const Utils::FileName &projectPath)
|
QStringList QmakeProjectImporter::importCandidates(const FileName &projectPath)
|
||||||
{
|
{
|
||||||
QStringList candidates;
|
QStringList candidates;
|
||||||
|
|
||||||
@@ -211,8 +212,7 @@ QStringList QmakeProjectImporter::importCandidates(const Utils::FileName &projec
|
|||||||
const QString prefix = pfi.baseName();
|
const QString prefix = pfi.baseName();
|
||||||
candidates << pfi.absolutePath();
|
candidates << pfi.absolutePath();
|
||||||
|
|
||||||
QList<ProjectExplorer::Kit *> kitList = ProjectExplorer::KitManager::kits();
|
foreach (Kit *k, KitManager::kits()) {
|
||||||
foreach (ProjectExplorer::Kit *k, kitList) {
|
|
||||||
QFileInfo fi(QmakeBuildConfiguration::shadowBuildDirectory(projectPath.toString(), k, QString()));
|
QFileInfo fi(QmakeBuildConfiguration::shadowBuildDirectory(projectPath.toString(), k, QString()));
|
||||||
const QString baseDir = fi.absolutePath();
|
const QString baseDir = fi.absolutePath();
|
||||||
|
|
||||||
@@ -225,18 +225,18 @@ QStringList QmakeProjectImporter::importCandidates(const Utils::FileName &projec
|
|||||||
return candidates;
|
return candidates;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::Target *QmakeProjectImporter::preferredTarget(const QList<ProjectExplorer::Target *> &possibleTargets)
|
Target *QmakeProjectImporter::preferredTarget(const QList<Target *> &possibleTargets)
|
||||||
{
|
{
|
||||||
// Select active target
|
// Select active target
|
||||||
// a) The default target
|
// a) The default target
|
||||||
// b) Simulator target
|
// b) Simulator target
|
||||||
// c) Desktop target
|
// c) Desktop target
|
||||||
// d) the first target
|
// d) the first target
|
||||||
ProjectExplorer::Target *activeTarget = possibleTargets.isEmpty() ? 0 : possibleTargets.at(0);
|
Target *activeTarget = possibleTargets.isEmpty() ? 0 : possibleTargets.at(0);
|
||||||
int activeTargetPriority = 0;
|
int activeTargetPriority = 0;
|
||||||
foreach (ProjectExplorer::Target *t, possibleTargets) {
|
foreach (Target *t, possibleTargets) {
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(t->kit());
|
BaseQtVersion *version = QtKitInformation::qtVersion(t->kit());
|
||||||
if (t->kit() == ProjectExplorer::KitManager::defaultKit()) {
|
if (t->kit() == KitManager::defaultKit()) {
|
||||||
activeTarget = t;
|
activeTarget = t;
|
||||||
activeTargetPriority = 3;
|
activeTargetPriority = 3;
|
||||||
} else if (activeTargetPriority < 2 && version && version->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)) {
|
} else if (activeTargetPriority < 2 && version && version->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)) {
|
||||||
@@ -250,74 +250,72 @@ ProjectExplorer::Target *QmakeProjectImporter::preferredTarget(const QList<Proje
|
|||||||
return activeTarget;
|
return activeTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmakeProjectImporter::cleanupKit(ProjectExplorer::Kit *k)
|
void QmakeProjectImporter::cleanupKit(Kit *k)
|
||||||
{
|
{
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtVersionManager::version(k->value(QT_IS_TEMPORARY, -1).toInt());
|
BaseQtVersion *version = QtVersionManager::version(k->value(QT_IS_TEMPORARY, -1).toInt());
|
||||||
if (!version)
|
if (!version)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// count how many kits are using this version
|
// count how many kits are using this version
|
||||||
int qtId = version->uniqueId();
|
int qtId = version->uniqueId();
|
||||||
int count = Utils::count(ProjectExplorer::KitManager::kits(), [qtId](ProjectExplorer::Kit *k) {
|
int users = Utils::count(KitManager::kits(), [qtId](Kit *k) {
|
||||||
return k->value(QT_IS_TEMPORARY, -1).toInt() == qtId;
|
return k->value(QT_IS_TEMPORARY, -1).toInt() == qtId;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (count == 0) // Remove if no other kit is using it. (The Kit k is not in KitManager::kits()
|
if (users == 0) // Remove if no other kit is using it. (The Kit k is not in KitManager::kits()
|
||||||
QtSupport::QtVersionManager::removeVersion(version);
|
QtVersionManager::removeVersion(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmakeProjectImporter::makePermanent(ProjectExplorer::Kit *k)
|
void QmakeProjectImporter::makePermanent(Kit *k)
|
||||||
{
|
{
|
||||||
if (!isTemporaryKit(k))
|
if (!isTemporaryKit(k))
|
||||||
return;
|
return;
|
||||||
setIsUpdating(true);
|
setIsUpdating(true);
|
||||||
int tempId = k->value(QT_IS_TEMPORARY, -1).toInt();
|
int tempId = k->value(QT_IS_TEMPORARY, -1).toInt();
|
||||||
int qtId = QtSupport::QtKitInformation::qtVersionId(k);
|
int qtId = QtKitInformation::qtVersionId(k);
|
||||||
if (tempId != qtId) {
|
if (tempId != qtId) {
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtVersionManager::version(tempId);
|
BaseQtVersion *version = QtVersionManager::version(tempId);
|
||||||
int count = Utils::count(ProjectExplorer::KitManager::kits(), [tempId](ProjectExplorer::Kit *k) {
|
int users = count(KitManager::kits(), [tempId](Kit *k) {
|
||||||
return k->value(QT_IS_TEMPORARY, -1).toInt() == tempId;
|
return k->value(QT_IS_TEMPORARY, -1).toInt() == tempId;
|
||||||
});
|
});
|
||||||
if (count == 0)
|
if (users == 0)
|
||||||
QtSupport::QtVersionManager::removeVersion(version);
|
QtVersionManager::removeVersion(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (ProjectExplorer::Kit *kit, ProjectExplorer::KitManager::kits())
|
foreach (Kit *kit, KitManager::kits())
|
||||||
if (kit->value(QT_IS_TEMPORARY, -1).toInt() == tempId)
|
if (kit->value(QT_IS_TEMPORARY, -1).toInt() == tempId)
|
||||||
kit->removeKeySilently(QT_IS_TEMPORARY);
|
kit->removeKeySilently(QT_IS_TEMPORARY);
|
||||||
setIsUpdating(false);
|
setIsUpdating(false);
|
||||||
ProjectImporter::makePermanent(k);
|
ProjectImporter::makePermanent(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
static ToolChain *preferredToolChain(BaseQtVersion *qtVersion, const FileName &ms, const QStringList &deducedArguments)
|
||||||
ProjectExplorer::ToolChain *preferredToolChain(QtSupport::BaseQtVersion *qtVersion, const Utils::FileName &ms, const QStringList &deducedArguments)
|
|
||||||
{
|
{
|
||||||
const Utils::FileName spec = ms.isEmpty() ? qtVersion->mkspec() : ms;
|
const FileName spec = ms.isEmpty() ? qtVersion->mkspec() : ms;
|
||||||
|
|
||||||
QList<ProjectExplorer::ToolChain *> toolchains = ProjectExplorer::ToolChainManager::toolChains();
|
QList<ToolChain *> toolchains = ToolChainManager::toolChains();
|
||||||
QList<ProjectExplorer::Abi> qtAbis = qtVersion->qtAbis();
|
QList<Abi> qtAbis = qtVersion->qtAbis();
|
||||||
return Utils::findOr(toolchains,
|
return findOr(toolchains,
|
||||||
toolchains.isEmpty() ? 0 : toolchains.first(),
|
toolchains.isEmpty() ? 0 : toolchains.first(),
|
||||||
[&spec, &deducedArguments, &qtAbis](ProjectExplorer::ToolChain *tc) -> bool{
|
[&spec, &deducedArguments, &qtAbis](ToolChain *tc) -> bool{
|
||||||
return qtAbis.contains(tc->targetAbi())
|
return qtAbis.contains(tc->targetAbi())
|
||||||
&& tc->suggestedMkspecList().contains(spec)
|
&& tc->suggestedMkspecList().contains(spec)
|
||||||
&& QmakeBuildConfiguration::deduceArgumnetsForTargetAbi(tc->targetAbi(), 0) == deducedArguments;
|
&& QmakeBuildConfiguration::deduceArgumnetsForTargetAbi(tc->targetAbi(), 0) == deducedArguments;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ProjectExplorer::Kit *QmakeProjectImporter::createTemporaryKit(QtSupport::BaseQtVersion *version,
|
Kit *QmakeProjectImporter::createTemporaryKit(BaseQtVersion *version,
|
||||||
bool temporaryVersion,
|
bool temporaryVersion,
|
||||||
const Utils::FileName &parsedSpec,
|
const FileName &parsedSpec,
|
||||||
const QStringList &deducedQmakeArguments)
|
const QStringList &deducedQmakeArguments)
|
||||||
{
|
{
|
||||||
ProjectExplorer::Kit *k = new ProjectExplorer::Kit;
|
Kit *k = new Kit;
|
||||||
bool oldIsUpdating = setIsUpdating(true);
|
bool oldIsUpdating = setIsUpdating(true);
|
||||||
{
|
{
|
||||||
ProjectExplorer::KitGuard guard(k);
|
KitGuard guard(k);
|
||||||
|
|
||||||
QtSupport::QtKitInformation::setQtVersion(k, version);
|
QtKitInformation::setQtVersion(k, version);
|
||||||
ProjectExplorer::ToolChainKitInformation::setToolChain(k, preferredToolChain(version, parsedSpec, deducedQmakeArguments));
|
ToolChainKitInformation::setToolChain(k, preferredToolChain(version, parsedSpec, deducedQmakeArguments));
|
||||||
QmakeKitInformation::setMkspec(k, parsedSpec);
|
QmakeKitInformation::setMkspec(k, parsedSpec);
|
||||||
|
|
||||||
markTemporary(k);
|
markTemporary(k);
|
||||||
@@ -325,16 +323,15 @@ ProjectExplorer::Kit *QmakeProjectImporter::createTemporaryKit(QtSupport::BaseQt
|
|||||||
k->setValue(QT_IS_TEMPORARY, version->uniqueId());
|
k->setValue(QT_IS_TEMPORARY, version->uniqueId());
|
||||||
|
|
||||||
// Set up other values:
|
// Set up other values:
|
||||||
foreach (ProjectExplorer::KitInformation *ki, ProjectExplorer::KitManager::kitInformation()) {
|
foreach (KitInformation *ki, KitManager::kitInformation()) {
|
||||||
if (ki->id() == ProjectExplorer::ToolChainKitInformation::id()
|
if (ki->id() == ToolChainKitInformation::id() || ki->id() == QtKitInformation::id())
|
||||||
|| ki->id() == QtSupport::QtKitInformation::id())
|
|
||||||
continue;
|
continue;
|
||||||
ki->setup(k);
|
ki->setup(k);
|
||||||
}
|
}
|
||||||
k->setUnexpandedDisplayName(version->displayName());;
|
k->setUnexpandedDisplayName(version->displayName());;
|
||||||
} // ~KitGuard, sending kitUpdated
|
} // ~KitGuard, sending kitUpdated
|
||||||
|
|
||||||
ProjectExplorer::KitManager::registerKit(k); // potentially adds kits to other targetsetuppages
|
KitManager::registerKit(k); // potentially adds kits to other targetsetuppages
|
||||||
setIsUpdating(oldIsUpdating);
|
setIsUpdating(oldIsUpdating);
|
||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user