* Runs the @p callback on all files that have @p projectItem as ancestor */
| 33 | * Runs the @p callback on all files that have @p projectItem as ancestor |
| 34 | */ |
| 35 | void forEachFile(const ProjectBaseItem* projectItem, |
| 36 | const std::function<void(ProjectFileItem*)>& callback) |
| 37 | { |
| 38 | if (auto* file = projectItem->file()) { |
| 39 | callback(file); |
| 40 | return; |
| 41 | } |
| 42 | |
| 43 | const auto children = projectItem->children(); |
| 44 | for (const auto *child : children) { |
| 45 | forEachFile(child, callback); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | QList<ProjectFileItem*> allFiles(const ProjectBaseItem* projectItem) |
| 50 | { |