ProjectExplorer: Move code to set up default project structure

Move the code used to set up the default project structure from the
Project into the sessionmanager. Now that the models are no longer
connected to the project this is the safer way as less change to the
projects logic is required.

Change-Id: Ib6b897f990a24d2dcce96a9821f090551fe45f13
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2017-03-16 15:03:45 +01:00
parent fdb40645a4
commit 2ff0d30829
3 changed files with 14 additions and 10 deletions

View File

@@ -417,13 +417,6 @@ void Project::setDocument(Core::IDocument *doc)
QTC_ASSERT(doc, return);
QTC_ASSERT(!d->m_document, return);
d->m_document = doc;
if (!d->m_rootProjectNode) {
auto newRoot = new ProjectNode(projectDirectory());
newRoot->setDisplayName(displayName());
newRoot->addNode(new FileNode(projectFilePath(), FileType::Project, false));
setRootProjectNode(newRoot);
}
}
void Project::setRootProjectNode(ProjectNode *root)