MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / collectFileListRecursively

Function collectFileListRecursively

launcher/MMCZip.cpp:421–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421bool collectFileListRecursively(const QString& rootDir, const QString& subDir, QFileInfoList* files, FilterFunction excludeFilter)
422{
423 QDir rootDirectory(rootDir);
424 if (!rootDirectory.exists())
425 return false;
426
427 QDir directory;
428 if (subDir == nullptr)
429 directory = rootDirectory;
430 else
431 directory = QDir(subDir);
432
433 if (!directory.exists())
434 return false; // shouldn't ever happen
435
436 // recurse directories
437 QFileInfoList entries = directory.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::Hidden);
438 for (const auto& e : entries) {
439 if (!collectFileListRecursively(rootDir, e.filePath(), files, excludeFilter))
440 return false;
441 }
442
443 // collect files
444 entries = directory.entryInfoList(QDir::Files);
445 for (const auto& e : entries) {
446 QString relativeFilePath = rootDirectory.relativeFilePath(e.absoluteFilePath());
447 if (excludeFilter && excludeFilter(relativeFilePath)) {
448 qDebug() << "Skipping file " << relativeFilePath;
449 continue;
450 }
451
452 files->append(e); // we want the original paths for compressDirFiles
453 }
454 return true;
455}
456
457#if defined(LAUNCHER_APPLICATION)
458void ExportToZipTask::executeTask()

Callers 4

createModdedJarFunction · 0.85
collectFilesMethod · 0.85
collectFilesMethod · 0.85
doExportMethod · 0.85

Calls 4

existsMethod · 0.80
filePathMethod · 0.80
appendMethod · 0.80
QDirClass · 0.70

Tested by

no test coverage detected