mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Filter out non-deck files when building VDS (#5748)
This commit is contained in:
parent
6c19254abd
commit
42301d4f1a
1 changed files with 7 additions and 1 deletions
|
|
@ -58,6 +58,12 @@ void VisualDeckStorageFolderDisplayWidget::refreshUi()
|
|||
header->setText(bannerText);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all files in the directory that have a .txt or .cod extension
|
||||
*
|
||||
* @param filePath The directory to search through
|
||||
* @param recursive Whether to search through subdirectories
|
||||
*/
|
||||
static QStringList getAllFiles(const QString &filePath, bool recursive)
|
||||
{
|
||||
QStringList allFiles;
|
||||
|
|
@ -65,7 +71,7 @@ static QStringList getAllFiles(const QString &filePath, bool recursive)
|
|||
// QDirIterator with QDir::Files ensures only files are listed (no directories)
|
||||
auto flags =
|
||||
recursive ? QDirIterator::Subdirectories | QDirIterator::FollowSymlinks : QDirIterator::NoIteratorFlags;
|
||||
QDirIterator it(filePath, QDir::Files, flags);
|
||||
QDirIterator it(filePath, {"*.txt", "*.cod"}, QDir::Files, flags);
|
||||
|
||||
while (it.hasNext()) {
|
||||
allFiles << it.next(); // Add each file path to the list
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue