diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-03-21 12:10:28 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-03-21 12:17:01 -0700 |
commit | ef50e5595e2b4c50a0f25534ca71e6d898c5b090 (patch) | |
tree | 7c7b33b9c75b5a12a984488047c7edd91c46dbd9 /launcher | |
parent | 02bf086c09a26fb7dfd9a95d2a6f81a7a7d4c161 (diff) | |
download | PrismLauncher-ef50e5595e2b4c50a0f25534ca71e6d898c5b090.tar.gz PrismLauncher-ef50e5595e2b4c50a0f25534ca71e6d898c5b090.tar.bz2 PrismLauncher-ef50e5595e2b4c50a0f25534ca71e6d898c5b090.zip |
fix: don't try to watch the entier filesystem by watching parent links
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher')
-rw-r--r-- | launcher/ui/dialogs/BlockedModsDialog.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/launcher/ui/dialogs/BlockedModsDialog.cpp b/launcher/ui/dialogs/BlockedModsDialog.cpp index 05f50c06..ac06625e 100644 --- a/launcher/ui/dialogs/BlockedModsDialog.cpp +++ b/launcher/ui/dialogs/BlockedModsDialog.cpp @@ -191,15 +191,19 @@ void BlockedModsDialog::setupWatch() void BlockedModsDialog::watchPath(QString path, bool watch_subdirectories) { + qDebug() << "[Blocked Mods Dialog] Adding Watch Path:" << path; m_watcher.addPath(path); if (!watch_subdirectories) return; - QDirIterator it(path, QDirIterator::Subdirectories); + QDirIterator it(path, QDir::Filter::Dirs, QDirIterator::NoIteratorFlags); while (it.hasNext()) { - QString dir = it.next(); - watchPath(it.next(), watch_subdirectories); + 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); } } |