fix: use QDir::Filter::NoDotAndDotDot

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2023-03-27 19:11:26 -07:00
parent a0045ece07
commit df17f5e899

View File

@ -198,12 +198,9 @@ void BlockedModsDialog::watchPath(QString path, bool watch_subdirectories)
if (!watch_subdirectories) if (!watch_subdirectories)
return; return;
QDirIterator it(path, QDir::Filter::Dirs, QDirIterator::NoIteratorFlags); QDirIterator it(path, QDir::Filter::Dirs | QDir::Filter::NoDotAndDotDot, QDirIterator::NoIteratorFlags);
while (it.hasNext()) { while (it.hasNext()) {
QString dir_path = it.next(); QString dir_path = it.next();
QDir to_watch_dir(dir_path);
if (to_watch_dir.dirName() == "." || to_watch_dir.dirName() == "..")
continue;
watchPath(dir_path, watch_subdirectories); watchPath(dir_path, watch_subdirectories);
} }
} }