Commit 5b9eaf74 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

QbsPM: Add nodes incrementally



Change-Id: Id53a0107df64b26d8ec57eda734635bda9e045f6
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 6815633d
...@@ -55,15 +55,13 @@ ProjectExplorer::FileType fileType(const qbs::ArtifactData &artifact) ...@@ -55,15 +55,13 @@ ProjectExplorer::FileType fileType(const qbs::ArtifactData &artifact)
void setupArtifacts(ProjectExplorer::FolderNode *root, const QList<qbs::ArtifactData> &artifacts) void setupArtifacts(ProjectExplorer::FolderNode *root, const QList<qbs::ArtifactData> &artifacts)
{ {
QList<ProjectExplorer::FileNode *> fileNodes for (const qbs::ArtifactData &ad : artifacts) {
= Utils::transform(artifacts, [](const qbs::ArtifactData &ad) {
const Utils::FileName path = Utils::FileName::fromString(ad.filePath()); const Utils::FileName path = Utils::FileName::fromString(ad.filePath());
const ProjectExplorer::FileType type = fileType(ad); const ProjectExplorer::FileType type = fileType(ad);
const bool isGenerated = ad.isGenerated(); const bool isGenerated = ad.isGenerated();
return new ProjectExplorer::FileNode(path, type, isGenerated); root->addNestedNode(new ProjectExplorer::FileNode(path, type, isGenerated));
}); };
root->addNestedNodes(fileNodes);
root->compress(); root->compress();
} }
...@@ -190,14 +188,12 @@ QbsRootProjectNode *QbsNodeTreeBuilder::buildTree(QbsProject *project) ...@@ -190,14 +188,12 @@ QbsRootProjectNode *QbsNodeTreeBuilder::buildTree(QbsProject *project)
ProjectExplorer::NodeType::Folder, ProjectExplorer::NodeType::Folder,
QCoreApplication::translate("QbsRootProjectNode", "Qbs files")); QCoreApplication::translate("QbsRootProjectNode", "Qbs files"));
QList<ProjectExplorer::FileNode *> projectBuildSystemFiles;
Utils::FileName base = project->projectDirectory(); Utils::FileName base = project->projectDirectory();
for (const QString &f : unreferencedBuildSystemFiles(project->qbsProject())) { for (const QString &f : unreferencedBuildSystemFiles(project->qbsProject())) {
const Utils::FileName filePath = Utils::FileName::fromString(f); const Utils::FileName filePath = Utils::FileName::fromString(f);
if (filePath.isChildOf(base)) if (filePath.isChildOf(base))
projectBuildSystemFiles.append(new ProjectExplorer::FileNode(filePath, ProjectExplorer::FileType::Project, false)); root->addNestedNode(new ProjectExplorer::FileNode(filePath, ProjectExplorer::FileType::Project, false));
} }
buildSystemFiles->addNestedNodes(projectBuildSystemFiles);
buildSystemFiles->compress(); buildSystemFiles->compress();
root->addNode(buildSystemFiles); root->addNode(buildSystemFiles);
......
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