mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
RemoveGameConfig improved
This commit is contained in:
parent
66835cf083
commit
4c789faea4
1 changed files with 15 additions and 4 deletions
|
@ -253,15 +253,26 @@ void GameViewer::RemoveGameConfig(wxCommandEvent& event)
|
||||||
long i = GetFirstSelected();
|
long i = GetFirstSelected();
|
||||||
if (i < 0) return;
|
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)
|
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)
|
static void open_dir(const std::string& spath)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue