mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-01 16:13:23 +00:00
RemoveGameConfig improved
This commit is contained in:
parent
66835cf083
commit
4c789faea4
@ -253,15 +253,26 @@ void GameViewer::RemoveGameConfig(wxCommandEvent& event)
|
||||
long i = GetFirstSelected();
|
||||
if (i < 0) return;
|
||||
|
||||
if (fs::exists(fs::get_config_dir() + "data/" + m_game_data[i].serial + "/config.yml"))
|
||||
const std::string config_path = fs::get_config_dir() + "data/" + m_game_data[i].serial + "/config.yml";
|
||||
|
||||
if (fs::is_file(config_path))
|
||||
{
|
||||
if (wxMessageBox("Delete custom game configuration?", "Confirm Delete", wxYES_NO | wxNO_DEFAULT) == wxYES)
|
||||
{
|
||||
fs::remove_file(fs::get_config_dir() + "data/" + m_game_data[i].serial + "/config.yml");
|
||||
if (fs::remove_file(config_path))
|
||||
{
|
||||
LOG_SUCCESS(GENERAL, "Removed configuration file: %s", config_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_FATAL(GENERAL, "Failed to delete configuration file: %s\nError: %s", config_path, fs::g_tls_error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Refresh();
|
||||
else
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Configuration file not found: %s", config_path);
|
||||
}
|
||||
}
|
||||
|
||||
static void open_dir(const std::string& spath)
|
||||
|
Loading…
x
Reference in New Issue
Block a user