Commit ffbc3311 authored by Tobias Hunger's avatar Tobias Hunger

ProjectExplorer: Use makeEmpty in FolderNode::buildTree

Some lines saved.

Change-Id: I5a5e2bb150070aae48ad0ec1abb08bc2532d093b
Reviewed-by: default avatarhjk <hjk@qt.io>
parent bd8fe1c4
...@@ -422,10 +422,7 @@ FolderNode *FolderNode::recursiveFindOrCreateFolderNode(const QString &directory ...@@ -422,10 +422,7 @@ FolderNode *FolderNode::recursiveFindOrCreateFolderNode(const QString &directory
void FolderNode::buildTree(QList<FileNode *> &files, const Utils::FileName &overrideBaseDir) void FolderNode::buildTree(QList<FileNode *> &files, const Utils::FileName &overrideBaseDir)
{ {
qDeleteAll(m_fileNodes); makeEmpty();
m_fileNodes.clear();
qDeleteAll(m_folderNodes);
m_folderNodes.clear();
foreach (ProjectExplorer::FileNode *fn, files) { foreach (ProjectExplorer::FileNode *fn, files) {
// Get relative path to rootNode // Get relative path to rootNode
...@@ -433,6 +430,8 @@ void FolderNode::buildTree(QList<FileNode *> &files, const Utils::FileName &over ...@@ -433,6 +430,8 @@ void FolderNode::buildTree(QList<FileNode *> &files, const Utils::FileName &over
ProjectExplorer::FolderNode *folder = recursiveFindOrCreateFolderNode(parentDir, overrideBaseDir); ProjectExplorer::FolderNode *folder = recursiveFindOrCreateFolderNode(parentDir, overrideBaseDir);
folder->addFileNode(fn); folder->addFileNode(fn);
} }
emitTreeChanged();
} }
void FolderNode::accept(NodesVisitor *visitor) void FolderNode::accept(NodesVisitor *visitor)
......
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