| 7 | namespace Override { |
| 8 | |
| 9 | void createOverrides(const QString& name, const QString& parent_folder, const QString& override_path) |
| 10 | { |
| 11 | QString file_path(FS::PathCombine(parent_folder, name + ".txt")); |
| 12 | if (QFile::exists(file_path)) |
| 13 | QFile::remove(file_path); |
| 14 | |
| 15 | FS::ensureFilePathExists(file_path); |
| 16 | |
| 17 | QFile file(file_path); |
| 18 | file.open(QFile::WriteOnly); |
| 19 | |
| 20 | QDirIterator override_iterator(override_path, QDirIterator::Subdirectories); |
| 21 | while (override_iterator.hasNext()) { |
| 22 | auto override_file_path = override_iterator.next(); |
| 23 | QFileInfo info(override_file_path); |
| 24 | if (info.isFile()) { |
| 25 | // Absolute path with temp directory -> relative path |
| 26 | override_file_path = override_file_path.split(name).last().remove(0, 1); |
| 27 | |
| 28 | file.write(override_file_path.toUtf8()); |
| 29 | file.write("\n"); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | file.close(); |
| 34 | } |
| 35 | |
| 36 | QStringList readOverrides(const QString& name, const QString& parent_folder) |
| 37 | { |
no test coverage detected