SessionManager: Simplify code

Change-Id: I97755d07f5d37452e01f6e687f1790dee33bb48e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Tobias Hunger
2016-05-09 13:30:30 +02:00
parent 4d617c8102
commit c64fa0d329

View File

@@ -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);
}
}