From 2ae9b010b32ff52ca73eaf8a076e109089cfb469 Mon Sep 17 00:00:00 2001 From: digant73 Date: Wed, 16 Apr 2025 11:59:00 +0200 Subject: [PATCH] minor cleanup --- rpcs3/Emu/System.cpp | 2 +- rpcs3/Emu/System.h | 2 +- rpcs3/rpcs3qt/vfs_dialog.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 1ca67ae58e..3aae20452a 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -4139,7 +4139,7 @@ game_boot_result Emulator::AddGameToYml(const std::string& path) return game_boot_result::invalid_file_or_folder; } -u32 Emulator::RemoveGamesFromDir(const std::string games_dir, const std::vector& serials_to_remove_from_yml, bool save_on_disk) +u32 Emulator::RemoveGamesFromDir(const std::string& games_dir, const std::vector& serials_to_remove_from_yml, bool save_on_disk) { // List of serials (title id) to remove in "games.yml" file (if any) std::vector serials_to_remove = serials_to_remove_from_yml; // Initialize the list with the specified serials (if any) diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index dde9b1d240..036215870f 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -454,7 +454,7 @@ public: u32 AddGamesFromDir(const std::string& path); game_boot_result AddGame(const std::string& path); game_boot_result AddGameToYml(const std::string& path); - u32 RemoveGamesFromDir(const std::string games_dir, const std::vector& serials_to_remove_from_yml = {}, bool save_on_disk = true); + u32 RemoveGamesFromDir(const std::string& games_dir, const std::vector& serials_to_remove_from_yml = {}, bool save_on_disk = true); u32 RemoveGames(const std::vector& title_id_list, bool save_on_disk = true); game_boot_result RemoveGameFromYml(const std::string& title_id); diff --git a/rpcs3/rpcs3qt/vfs_dialog.cpp b/rpcs3/rpcs3qt/vfs_dialog.cpp index eb1cc42dfe..9a22017437 100644 --- a/rpcs3/rpcs3qt/vfs_dialog.cpp +++ b/rpcs3/rpcs3qt/vfs_dialog.cpp @@ -79,11 +79,11 @@ vfs_dialog::vfs_dialog(std::shared_ptr _gui_settings, QWidget* par } else if (tabs->tabText(i) == "games") { - if (rpcs3::utils::get_games_dir() != static_cast(tabs->widget(i))->get_selected_path()) - { // If folder on "games" tab has been changed, reconciliate the game list first - + // Check if the games folder changed. If changed, reconciliate the game list for the old folder before setting the new one + if (const std::string games_dir = rpcs3::utils::get_games_dir(); games_dir != static_cast(tabs->widget(i))->get_selected_path()) + { // Remove the detected serials (title id) belonging to old folder from the game list in memory and also in "games.yml" file - Emu.RemoveGamesFromDir(rpcs3::utils::get_games_dir()); + Emu.RemoveGamesFromDir(games_dir); } static_cast(tabs->widget(i))->set_settings(); // set new folder