fs: Fix directory scanning crashes and optimize library performance & Include a Progress Bar #72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fs/linux-ntfs-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This commit addresses a critical crash occurring when scanning directories on non-Windows platforms (Linux in particular) using NTFS mounts, specifically targeting infinite recursion in junction points such as "Application Data".
Key Changes:
Thread Safety: Wrapped worker thread logic in try-catch blocks to prevent unhandled exceptions from reaching Qt Concurrent and triggering a std::terminate() crash.
Filesystem Logic: Switched from throwing std::filesystem methods to non-throwing overloads with std::error_code. Implemented a recursion depth limit and a platform-aware blacklist (#ifndef _WIN32) to skip Windows system folders and loops on non-Windows platforms.
Performance Optimization: Optimized GameListWorker by combining the content provider and library scans into a single pass (ScanTarget::Both), halving disk I/O and seek times on mechanical HDDs.
Filtering: Introduced early extension filtering to prevent the emulator from opening and probing non-game files, and fixed a double-increment bug in the directory iterator that caused some games to be skipped.
UI Enhancement: Added a "Scan for .nca files" toggle in UI Settings for Filesystem (defaulting to false)
UI Progress: Added a progress bar that showcases on top of the game_list to allow users visual representation of the progress being made scanning their directories instead of just a weird "hang".
Platform Compatibility:
Windows: Blacklist logic is bypassed via preprocessor macros to maintain native junction handling.
Linux/Android/macOS: Protects against ELOOP errors (too many symlinks) and significantly improves scan speed on external or primary Windows mounts.
General: Increases application stability across all platforms by ensuring worker thread exceptions are handled locally.