Commit 721b0f70 authored by Daniel Teske's avatar Daniel Teske
Browse files

GenericProject: Ensure that special nodes are only added once



Task-number: QTCREATORBUG-13106
Change-Id: I3db25390879489a898bb263405319deb80a53092
Reviewed-by: default avatarAndré Hartmann <aha_1980@gmx.de>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 656bcc4c
...@@ -93,6 +93,23 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName) ...@@ -93,6 +93,23 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName)
m_rootNode = new GenericProjectNode(this, m_creatorIDocument); m_rootNode = new GenericProjectNode(this, m_creatorIDocument);
FileNode *projectFilesNode = new FileNode(m_filesFileName,
ProjectFileType,
/* generated = */ false);
FileNode *projectIncludesNode = new FileNode(m_includesFileName,
ProjectFileType,
/* generated = */ false);
FileNode *projectConfigNode = new FileNode(m_configFileName,
ProjectFileType,
/* generated = */ false);
m_rootNode->addFileNodes(QList<FileNode *>()
<< projectFilesNode
<< projectIncludesNode
<< projectConfigNode);
m_manager->registerProject(this); m_manager->registerProject(this);
} }
......
...@@ -86,26 +86,6 @@ void GenericProjectNode::refresh(QSet<QString> oldFileList) ...@@ -86,26 +86,6 @@ void GenericProjectNode::refresh(QSet<QString> oldFileList)
typedef QHash<QString, QStringList> FilesInPathHash; typedef QHash<QString, QStringList> FilesInPathHash;
typedef FilesInPathHash::ConstIterator FilesInPathHashConstIt; typedef FilesInPathHash::ConstIterator FilesInPathHashConstIt;
if (oldFileList.isEmpty()) {
// Only do this once
FileNode *projectFilesNode = new FileNode(m_project->filesFileName(),
ProjectFileType,
/* generated = */ false);
FileNode *projectIncludesNode = new FileNode(m_project->includesFileName(),
ProjectFileType,
/* generated = */ false);
FileNode *projectConfigNode = new FileNode(m_project->configFileName(),
ProjectFileType,
/* generated = */ false);
addFileNodes(QList<FileNode *>()
<< projectFilesNode
<< projectIncludesNode
<< projectConfigNode);
}
// Do those separately // Do those separately
oldFileList.remove(m_project->filesFileName()); oldFileList.remove(m_project->filesFileName());
oldFileList.remove(m_project->includesFileName()); oldFileList.remove(m_project->includesFileName());
......
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