forked from qt-creator/qt-creator
SessionManager: Simplify code
Change-Id: I97755d07f5d37452e01f6e687f1790dee33bb48e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user