forked from qt-creator/qt-creator
ProjectTree: Decouple ProjectTree from Projects
Make sure the ProjectTree gets its data exclusively from the Session and the SessionNode it holds. Change-Id: Ic44e1364adf36077018edc972e18815d7f972922 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -680,6 +680,15 @@ Project *SessionManager::projectForNode(Node *node)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Node *SessionManager::nodeForProject(Project *project)
|
||||
{
|
||||
for (const QPair<Project *,ProjectNode*> &pair : d->m_projects) {
|
||||
if (pair.first == project)
|
||||
return pair.second;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Project *SessionManager::projectForFile(const Utils::FileName &fileName)
|
||||
{
|
||||
const QList<Project *> &projectList = projects();
|
||||
|
||||
Reference in New Issue
Block a user