Commit b913e9d5 authored by Tobias Hunger's avatar Tobias Hunger

ProjectExplorer: Make imported buildconfiguration active

Make the new buildconfiguration active after it was imported via
Project Mode. Before the buildconfiguration was added but the
current one was still set, which lead people to believe that the
build directory was wrong.

Task-number: QTCREATORBUG-18082
Change-Id: I10412d94326d9e21820dfcac89adbe2c5da948ae
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent eb8075f5
......@@ -548,6 +548,8 @@ public:
dir);
FileName path = FileName::fromString(importDir);
Target *lastTarget = nullptr;
BuildConfiguration *lastBc = nullptr;
const QList<BuildInfo *> toImport = projectImporter->import(path, false);
for (BuildInfo *info : toImport) {
Target *target = project->target(info->kitId);
......@@ -561,8 +563,16 @@ public:
BuildConfiguration *bc = info->factory()->create(target, info);
QTC_ASSERT(bc, continue);
target->addBuildConfiguration(bc);
lastTarget = target;
lastBc = bc;
}
}
if (lastTarget && lastBc) {
SessionManager::setActiveBuildConfiguration(lastTarget, lastBc, SetActive::Cascade);
SessionManager::setActiveTarget(project, lastTarget, SetActive::Cascade);
}
qDeleteAll(toImport);
}
......
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