| 43 | } |
| 44 | |
| 45 | QSet<QString> TestUtils::getFilesSet(const QString &path, int limit, int depch) { |
| 46 | QFileInfo info(path); |
| 47 | |
| 48 | if (limit > 0 && depch >= limit) { |
| 49 | return {}; |
| 50 | } |
| 51 | |
| 52 | if (!info.exists()) { |
| 53 | return {}; |
| 54 | } |
| 55 | |
| 56 | auto result = QSet<QString>{}; |
| 57 | |
| 58 | if (!info.isDir()) { |
| 59 | result.insert(getFilePath(info.fileName())); |
| 60 | return result; |
| 61 | } |
| 62 | |
| 63 | QDir dir(info.absoluteFilePath()); |
| 64 | auto list = dir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden); |
| 65 | for (const auto &i: std::as_const(list)) { |
| 66 | result.unite(getFilesSet(i.absoluteFilePath(), limit, depch + 1)); |
| 67 | } |
| 68 | |
| 69 | return result; |
| 70 | } |
| 71 | |
| 72 | QString TestUtils::getFilePath(const QString& i) { |
| 73 | auto file = i; |