Commit 9e8b427a authored by Tobias Hunger's avatar Tobias Hunger Committed by hjk

ProjectExplorer: Nodes: Do not makeEmpty() as part of buildTree()

Do not call makeEmpty() as part of buildTree(). That makes it
impossible to combine buildTree with manual tree setup.

Change-Id: If0a0d9432fe39870917a6ba31594e8dcd6d31868
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 919ba9a9
......@@ -229,6 +229,7 @@ void AutotoolsProject::makefileParsingFinished()
f == QLatin1String("configure.ac")) ? FileType::Project : FileType::Resource,
false);
});
rootProjectNode()->makeEmpty();
rootProjectNode()->buildTree(fileNodes);
updateCppCodeModel();
......
......@@ -282,6 +282,7 @@ void GenericProject::refresh(RefreshOptions options)
FileType::Project,
/* generated = */ false);
fileNodes << projectFilesNode << projectIncludesNode << projectConfigNode;
rootProjectNode()->makeEmpty();
rootProjectNode()->buildTree(fileNodes);
}
......
......@@ -159,6 +159,7 @@ void NimProject::updateProject()
if (oldFiles == m_files)
return;
rootProjectNode()->makeEmpty();
rootProjectNode()->buildTree(fileNodes);
emit fileListChanged();
......
......@@ -478,8 +478,6 @@ FolderNode *FolderNode::recursiveFindOrCreateFolderNode(const Utils::FileName &d
void FolderNode::buildTree(QList<FileNode *> &files, const Utils::FileName &overrideBaseDir)
{
makeEmpty();
foreach (ProjectExplorer::FileNode *fn, files) {
// Get relative path to rootNode
QString parentDir = fn->filePath().toFileInfo().absolutePath();
......
......@@ -618,6 +618,7 @@ void PythonProject::refresh()
const QString displayName = baseDir.relativeFilePath(f);
return new PythonFileNode(FileName::fromString(f), displayName);
});
rootProjectNode()->makeEmpty();
rootProjectNode()->buildTree(fileNodes);
emit parsingFinished();
......
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