Remove a code for Subprojects mode

After fixing QTCREATORBUG-17977 we don't have Subprojects
mode anymore, since currently Parser::addProjectTree() and
Parser::addFlatTree() are identical. For now, we just
remove this duplication. The subproject mode to be fixed later.

Amends 8634aa4cbd

Change-Id: I53d1b5a7354295449c2995c4421f8fa21a3ac2be
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2021-02-11 16:18:46 +01:00
parent ad2155d793
commit 480220a7e7
2 changed files with 2 additions and 42 deletions

View File

@@ -281,10 +281,7 @@ ParserTreeItem::ConstPtr Parser::parse()
SymbolInformation inf(prjName, prjType);
item = ParserTreeItem::Ptr(new ParserTreeItem());
if (d->flatMode)
addFlatTree(item, prj);
else
addProjectTree(item, prj);
addFlatTree(item, prj);
item->setIcon(prj->containerNode()->icon());
@@ -647,40 +644,6 @@ void Parser::requestCurrentState()
emit treeDataUpdate(std);
}
/*!
Generates projects like the Project Explorer.
\a item specifies the item and \a node specifies the root node.
Returns a list of projects which were added to the item.
*/
QStringList Parser::addProjectTree(const ParserTreeItem::Ptr &item, const Project *project)
{
QStringList projectList;
if (!project)
return projectList;
const QString projectPath = project->projectFilePath().toString();
// our own files
QStringList fileList;
CitCachedPrjFileLists cit = d->cachedPrjFileLists.constFind(projectPath);
// try to improve parsing speed by internal cache
if (cit != d->cachedPrjFileLists.constEnd()) {
fileList = cit.value();
} else {
fileList = Utils::transform(project->files(Project::SourceFiles), &FilePath::toString);
d->cachedPrjFileLists[projectPath] = fileList;
}
if (fileList.count() > 0) {
addProject(item, fileList, projectPath);
projectList << projectPath;
}
return projectList;
}
QStringList Parser::getAllFiles(const Project *project)
{
QStringList fileList;
@@ -707,11 +670,9 @@ void Parser::addFlatTree(const ParserTreeItem::Ptr &item, const Project *project
return;
QStringList fileList = getAllFiles(project);
fileList.removeDuplicates();
if (fileList.count() > 0) {
if (fileList.count() > 0)
addProject(item, fileList, project->projectFilePath().toString());
}
}
} // namespace Internal