minor cleanup

This commit is contained in:
digant73 2025-04-16 11:59:00 +02:00
parent c5c99ec438
commit 2ae9b010b3
3 changed files with 6 additions and 6 deletions

View file

@ -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<std::string>& serials_to_remove_from_yml, bool save_on_disk)
u32 Emulator::RemoveGamesFromDir(const std::string& games_dir, const std::vector<std::string>& serials_to_remove_from_yml, bool save_on_disk)
{
// List of serials (title id) to remove in "games.yml" file (if any)
std::vector<std::string> serials_to_remove = serials_to_remove_from_yml; // Initialize the list with the specified serials (if any)

View file

@ -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<std::string>& serials_to_remove_from_yml = {}, bool save_on_disk = true);
u32 RemoveGamesFromDir(const std::string& games_dir, const std::vector<std::string>& serials_to_remove_from_yml = {}, bool save_on_disk = true);
u32 RemoveGames(const std::vector<std::string>& title_id_list, bool save_on_disk = true);
game_boot_result RemoveGameFromYml(const std::string& title_id);

View file

@ -79,11 +79,11 @@ vfs_dialog::vfs_dialog(std::shared_ptr<gui_settings> _gui_settings, QWidget* par
}
else if (tabs->tabText(i) == "games")
{
if (rpcs3::utils::get_games_dir() != static_cast<vfs_dialog_tab*>(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<vfs_dialog_tab*>(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<vfs_dialog_tab*>(tabs->widget(i))->set_settings(); // set new folder