Commit 6b469e81 authored by Tobias Hunger's avatar Tobias Hunger Committed by Tim Jenssen
Browse files

ProjectExplorer: Never delete base node when building a tree



Never delete the base folder node when using buildTree to set up
a tree of files in the project tree. This makes sure the node stays
around, even when it turns empty. This matches how buildTree is used
in our code.

Change-Id: Id2a589985d9ac704316db5f210232532dcdb5d58
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent e3b38b8a
......@@ -411,6 +411,10 @@ void FolderNode::buildTree(QList<FileNode *> &files)
for (auto i = deletedFolderMapping.constBegin(); i != deletedFolderMapping.constEnd(); ++i) {
ProjectExplorer::FolderNode *parent = i.key();
parent->removeFileNodes(i.value());
if (parent == this) // Never delete this node!
continue;
// Check for empty parent
while (parent->subFolderNodes().isEmpty() && parent->fileNodes().isEmpty()) {
ProjectExplorer::FolderNode *grandparent = parent->parentFolderNode();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment