Commit c64fa0d3 authored by Tobias Hunger's avatar Tobias Hunger

SessionManager: Simplify code

Change-Id: I97755d07f5d37452e01f6e687f1790dee33bb48e
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 4d617c81
......@@ -291,12 +291,9 @@ void SessionManager::setActiveTarget(Project *project, Target *target, SetActive
foreach (Project *otherProject, SessionManager::projects()) {
if (otherProject == project)
continue;
foreach (Target *otherTarget, otherProject->targets()) {
if (otherTarget->kit()->id() == kitId) {
otherProject->setActiveTarget(otherTarget);
break;
}
}
if (Target *otherTarget = Utils::findOrDefault(otherProject->targets(),
[kitId](Target *t) { return t->kit()->id() == kitId; }))
otherProject->setActiveTarget(otherTarget);
}
}
......
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