ProjectExplorer: Introduce some FolderNode convenience functions

... and use them.

Change-Id: I9f5237e5eac30715c2effbd3301dd2a70516d2a9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2017-01-26 17:02:16 +01:00
parent 8427932a0e
commit 87304b3ce0
8 changed files with 117 additions and 139 deletions

View File

@@ -121,7 +121,6 @@ ResourceTopLevelNode::~ResourceTopLevelNode()
void ResourceTopLevelNode::update()
{
QList<ProjectExplorer::FolderNode *> newPrefixList;
QMap<PrefixFolderLang, QList<ProjectExplorer::FileNode *>> filesToAdd;
QMap<PrefixFolderLang, QList<ProjectExplorer::FolderNode *>> foldersToAddToFolders;
QMap<PrefixFolderLang, QList<ProjectExplorer::FolderNode *>> foldersToAddToPrefix;
@@ -139,8 +138,7 @@ void ResourceTopLevelNode::update()
PrefixFolderLang prefixId(prefix, QString(), lang);
if (!prefixNodes.contains(prefixId)) {
ProjectExplorer::FolderNode *fn = new ResourceFolderNode(file.prefix(i), file.lang(i), this);
newPrefixList << fn;
addFolderNode(fn);
prefixNodes.insert(prefixId, fn);
}
ResourceFolderNode *currentPrefixNode = static_cast<ResourceFolderNode*>(prefixNodes[prefixId]);
@@ -208,9 +206,6 @@ void ResourceTopLevelNode::update()
}
}
addFolderNodes(newPrefixList);
foreach (FolderNode *sfn, folderNodes()) {
ResourceFolderNode *srn = static_cast<ResourceFolderNode *>(sfn);
PrefixFolderLang folderId(srn->prefix(), QString(), srn->lang());