| 120 | } |
| 121 | |
| 122 | void TestProjectUtils::addChildrenFromFileSystem(ProjectFolderItem* parent) |
| 123 | { |
| 124 | constexpr QDir::Filters entryFilter = QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden; |
| 125 | QDirIterator it(parent->path().path(), {QStringLiteral("*")}, entryFilter); |
| 126 | while (it.hasNext()) { |
| 127 | it.next(); |
| 128 | const auto info = it.fileInfo(); |
| 129 | if (info.isDir()) { |
| 130 | const auto child = createChild<ProjectFolderItem>(parent, info.fileName()); |
| 131 | addChildrenFromFileSystem(child); |
| 132 | } else { |
| 133 | createChild<ProjectFileItem>(parent, info.fileName()); |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | #include "moc_testproject.cpp" |