eden/src/common/fs
crueter badd913bee
[desktop] fix save data location, orphaned profiles finder (#2678)
Previously, if the user had their NAND in a nonstandard location,
profiles.dat would be read from the standard Eden path and thus return
effectively garbage data. What this would result in is:

- The Qt profile manager would be completely nonfunctional
- "Open Save Data Location" would put you into the completely wrong
  place
- Games would read from incorrect locations for their saves

To solve this, I made it so that profiles.dat is re-read *after*
QtConfig initializes. It's not the perfect solution, but it works.

Additionally, this adds an orphaned profiles finder:
- walks through the save folders in nand/user/save/000.../
- for each subdirectory, checks to see if profiles.dat contains a
  corresponding UUID
- If not, the profile is "orphaned". It may contain legit save data, so
  let the user decide how to handle it (famous last words)
- Empty profiles are just removed. If they really matter, they're
  instantly recreated anyways.

The orphaned profiles check runs right *after* the decryption keys
check, but before the game list ever gets populated

Signed-off-by: crueter <crueter@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2678
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2025-10-07 01:32:09 +02:00
..
file.cpp common: include missing headers after PCH disable (#2626) 2025-09-30 04:25:29 +02:00
file.h [cmake] refactor: CPM over vcpkg (#250) 2025-08-14 20:30:30 +02:00
fs.cpp add std::error_code for std::filesystem exceptions 2023-09-15 04:47:15 +10:00
fs.h general: Convert source file copyright comments over to SPDX 2022-04-23 05:55:32 -04:00
fs_android.cpp common: fs: Expand android macros 2024-02-08 14:13:46 -05:00
fs_android.h common: fs: Expand android macros 2024-02-08 14:13:46 -05:00
fs_paths.h [user] prioritize 'user' directory if it exists (without needing a portable build) + docs (#338) 2025-09-08 00:57:08 +02:00
fs_types.h [desktop] fix save data location, orphaned profiles finder (#2678) 2025-10-07 01:32:09 +02:00
fs_util.cpp [common] remove ranges polyfill (#2546) 2025-09-24 19:29:48 +02:00
fs_util.h general: Convert source file copyright comments over to SPDX 2022-04-23 05:55:32 -04:00
path_util.cpp common: include missing headers after PCH disable (#2626) 2025-09-30 04:25:29 +02:00
path_util.h [common, fs] Use std::string_view instead of std::string&; inline functions that are used rarely (#330) 2025-08-27 22:21:04 +02:00