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:
Tobias Hunger
2017-03-16 15:02:23 +01:00
parent 2b6a912e6b
commit 9434fa4888
3 changed files with 12 additions and 2 deletions

View File

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