forked from qt-creator/qt-creator
ProjectExplorer: Create initial project tree
Create an initial project tree with a ProjectNode and a FileNode for the project file itself. Fix the Projects to not implement their own tree before they have better data. Change-Id: I147ccd5603d22d1d60880a97f30fd8c271eac88c Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -416,6 +416,13 @@ 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)
|
||||
|
||||
Reference in New Issue
Block a user