Commit 69ccc06d authored by Tobias Hunger's avatar Tobias Hunger

Import to all possible kits

List any detected build in all kits that match the characteristics
of the project build settings found when importing a build for
unconfigured projects.

So far we just listed it with the first kit we found which is
surprising sometimes (e.g. when having a embedded linux and a desktop
kit using the same Qt version).

Change-Id: I9d1de26eca3dcabd424064a66019f5f6be876249
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 3f6c2319
......@@ -298,7 +298,6 @@ ProjectExplorer::Kit *TargetSetupPage::createTemporaryKit(QtSupport::BaseQtVersi
k->setDisplayName(version->displayName());
k->setValue(KIT_IS_TEMPORARY, true);
k->setValue(TEMPORARY_OF_PROJECTS, QStringList() << m_proFilePath);
if (temporaryVersion)
k->setValue(QT_IS_TEMPORARY, version->uniqueId());
......@@ -395,7 +394,6 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
QtSupport::BaseQtVersion *version = 0;
bool temporaryVersion = false;
ProjectExplorer::Kit *kit = 0;
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
ProjectExplorer::KitManager *km = ProjectExplorer::KitManager::instance();
......@@ -438,7 +436,8 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
specArgument = QLatin1String("-spec ") + Utils::QtcProcess::quoteArg(parsedSpec.toUserOutput());
Utils::QtcProcess::addArgs(&specArgument, additionalArguments);
// Find profile:
// Find profiles (can be more than one, e.g. (Linux-)Desktop and embedded linux):
QList<ProjectExplorer::Kit *> kitList;
foreach (ProjectExplorer::Kit *k, km->kits()) {
QtSupport::BaseQtVersion *profileVersion = QtSupport::QtKitInformation::qtVersion(k);
Utils::FileName profileSpec = QmakeKitInformation::mkspec(k);
......@@ -448,18 +447,19 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
if (profileVersion == version
&& profileSpec == parsedSpec)
kit = k;
kitList.append(k);
}
if (!kit)
kit = createTemporaryKit(version, temporaryVersion, parsedSpec);
else
addProject(kit, m_proFilePath);
if (kitList.isEmpty())
kitList.append(createTemporaryKit(version, temporaryVersion, parsedSpec));
foreach (ProjectExplorer::Kit *k, kitList) {
addProject(k, m_proFilePath);
// Create widget:
Qt4TargetSetupWidget *widget = m_widgets.value(kit->id(), 0);
Qt4TargetSetupWidget *widget = m_widgets.value(k->id(), 0);
if (!widget)
addWidget(kit);
widget = m_widgets.value(kit->id(), 0);
addWidget(k);
widget = m_widgets.value(k->id(), 0);
if (!widget)
continue;
......@@ -474,6 +474,7 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
widget->setKitSelected(true);
found = true;
}
}
updateVisibility();
......
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