diff --git a/src/citron/main.cpp b/src/citron/main.cpp index 86b7e9251..534bb97eb 100644 --- a/src/citron/main.cpp +++ b/src/citron/main.cpp @@ -2308,6 +2308,13 @@ void GMainWindow::OnEmulationStopped() { emulation_running = false; + // Reset the startup sync flag for the next session. + has_performed_initial_sync = false; + LOG_INFO(Frontend, "Mirroring: Emulation stopped. Re-arming startup sync for next game list refresh."); + + // This is necessary to reset the in-memory state for the next launch. + system->GetFileSystemController().CreateFactories(*vfs, true); + discord_rpc->Update(); #ifdef __unix__ @@ -2426,30 +2433,28 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target case GameListOpenTarget::SaveData: { open_target = tr("Save Data"); - // 1. Check for Mirrored Path FIRST (opens the external directory) + // 1. Priority 1: Mirrored Path (opens the external directory) if (Settings::values.mirrored_save_paths.count(program_id)) { const std::string& mirrored_path_str = Settings::values.mirrored_save_paths.at(program_id); if (!mirrored_path_str.empty() && Common::FS::IsDir(mirrored_path_str)) { - LOG_INFO(Frontend, "Opening mirrored save data path for program_id={:016x}", + LOG_INFO(Frontend, "Opening external mirrored save data path for program_id={:016x}", program_id); QDesktopServices::openUrl( QUrl::fromLocalFile(QString::fromStdString(mirrored_path_str))); return; } } - // 2. Check for Per-Game Custom Path + // 2. Priority 2: Per-Game Custom Path else if (Settings::values.custom_save_paths.count(program_id)) { const std::string& custom_path_str = Settings::values.custom_save_paths.at(program_id); if (!custom_path_str.empty() && Common::FS::IsDir(custom_path_str)) { - LOG_INFO(Frontend, "Opening custom save data path for program_id={:016x}", - program_id); - QDesktopServices::openUrl( - QUrl::fromLocalFile(QString::fromStdString(custom_path_str))); + LOG_INFO(Frontend, "Opening per-game custom save data path for program_id={:016x}", program_id); + QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(custom_path_str))); return; } } - // 3. Check for Global Custom Save Path + // 3. Priority 3: Global Custom Path else if (Settings::values.global_custom_save_path_enabled.GetValue()) { const std::string& global_path_str = Settings::values.global_custom_save_path.GetValue();