Skip to content

Commit

Permalink
replace 'folderNodes()'
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch authored and christian-rauch committed Jul 24, 2023
1 parent 98e8a6a commit 8e81cef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/project_manager/ros_project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ namespace Internal {

static FolderNode *folderNode(const FolderNode *folder, const Utils::FilePath &directory)
{
return static_cast<FolderNode *>(Utils::findOrDefault(folder->folderNodes(),
[&directory](const FolderNode *fn) {
return static_cast<FolderNode *>(folder->findChildFolderNode([&](FolderNode *fn) {
return fn && fn->filePath() == directory;
}));
}
Expand Down
15 changes: 8 additions & 7 deletions src/project_manager/ros_project_nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ FileNode *ROSProjectNode::findFileNode(FolderNode *folder_node, const Utils::Fil
if (file_node)
return file_node;

for (FolderNode *fn : folder_node->folderNodes())
{
file_node = findFileNode(fn, filePaths);
if (file_node)
return file_node;
}
folder_node->findChildFolderNode([&](FolderNode *folder_node) {
file_node = findFileNode(folder_node, filePaths);
return bool(file_node);
});

return nullptr;
if (file_node)
return file_node;
else
return nullptr;
}

bool ROSProjectNode::showInSimpleTree() const
Expand Down

0 comments on commit 8e81cef

Please sign in to comment.