mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
System: remove deprecated custom config location
This commit is contained in:
parent
1a443cf6b5
commit
69faf14a79
@ -601,36 +601,24 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
|
||||
|
||||
if (!add_only && !force_global_config && m_config_override_path.empty())
|
||||
{
|
||||
const std::string config_path_new = rpcs3::utils::get_custom_config_path(m_title_id);
|
||||
const std::string config_path_old = rpcs3::utils::get_custom_config_path(m_title_id, true);
|
||||
const std::string config_path = rpcs3::utils::get_custom_config_path(m_title_id);
|
||||
|
||||
// Load custom config-1
|
||||
if (fs::file cfg_file{ config_path_old })
|
||||
if (fs::file cfg_file{ config_path })
|
||||
{
|
||||
sys_log.notice("Applying custom config: %s", config_path_old);
|
||||
sys_log.notice("Applying custom config: %s", config_path);
|
||||
|
||||
if (!g_cfg.from_string(cfg_file.to_string()))
|
||||
if (g_cfg.from_string(cfg_file.to_string()))
|
||||
{
|
||||
sys_log.fatal("Failed to apply custom config: %s", config_path_old);
|
||||
g_cfg.name = config_path;
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log.fatal("Failed to apply custom config: %s", config_path);
|
||||
}
|
||||
}
|
||||
|
||||
// Load custom config-2
|
||||
if (fs::file cfg_file{ config_path_new })
|
||||
{
|
||||
sys_log.notice("Applying custom config: %s", config_path_new);
|
||||
|
||||
if (g_cfg.from_string(cfg_file.to_string()))
|
||||
{
|
||||
g_cfg.name = config_path_new;
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log.fatal("Failed to apply custom config: %s", config_path_new);
|
||||
}
|
||||
}
|
||||
|
||||
// Load custom config-3
|
||||
if (fs::file cfg_file{ m_path + ".yml" })
|
||||
{
|
||||
sys_log.notice("Applying custom config: %s.yml", m_path);
|
||||
|
@ -214,16 +214,9 @@ namespace rpcs3::utils
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string get_custom_config_path(const std::string& title_id, bool get_deprecated_path)
|
||||
std::string get_custom_config_path(const std::string& title_id)
|
||||
{
|
||||
std::string path;
|
||||
|
||||
if (get_deprecated_path)
|
||||
path = fs::get_config_dir() + "data/" + title_id + "/config.yml";
|
||||
else
|
||||
path = get_custom_config_dir() + "config_" + title_id + ".yml";
|
||||
|
||||
return path;
|
||||
return get_custom_config_dir() + "config_" + title_id + ".yml";
|
||||
}
|
||||
|
||||
std::string get_input_config_root()
|
||||
|
@ -26,7 +26,7 @@ namespace rpcs3::utils
|
||||
std::string get_sfo_dir_from_game_path(const std::string& game_path, const std::string& title_id = "");
|
||||
|
||||
std::string get_custom_config_dir();
|
||||
std::string get_custom_config_path(const std::string& title_id, bool get_deprecated_path = false);
|
||||
std::string get_custom_config_path(const std::string& title_id);
|
||||
|
||||
std::string get_input_config_root();
|
||||
std::string get_input_config_dir(const std::string& title_id = "");
|
||||
|
@ -140,17 +140,12 @@ void emu_settings::LoadSettings(const std::string& title_id)
|
||||
// Otherwise we'll always trigger the "obsolete settings dialog" when editing custom configs.
|
||||
ValidateSettings(true);
|
||||
|
||||
const std::string config_path_new = rpcs3::utils::get_custom_config_path(m_title_id);
|
||||
const std::string config_path_old = rpcs3::utils::get_custom_config_path(m_title_id, true);
|
||||
const std::string config_path = rpcs3::utils::get_custom_config_path(m_title_id);
|
||||
std::string custom_config_path;
|
||||
|
||||
if (fs::is_file(config_path_new))
|
||||
if (fs::is_file(config_path))
|
||||
{
|
||||
custom_config_path = config_path_new;
|
||||
}
|
||||
else if (fs::is_file(config_path_old))
|
||||
{
|
||||
custom_config_path = config_path_old;
|
||||
custom_config_path = config_path;
|
||||
}
|
||||
|
||||
if (!custom_config_path.empty())
|
||||
|
@ -665,7 +665,7 @@ void game_list_frame::Refresh(const bool from_drive, const bool scroll_after)
|
||||
m_mutex_cat.unlock();
|
||||
|
||||
const auto compat = m_game_compat->GetCompatibility(game.serial);
|
||||
const bool hasCustomConfig = fs::is_file(rpcs3::utils::get_custom_config_path(game.serial)) || fs::is_file(rpcs3::utils::get_custom_config_path(game.serial, true));
|
||||
const bool hasCustomConfig = fs::is_file(rpcs3::utils::get_custom_config_path(game.serial));
|
||||
const bool hasCustomPadConfig = fs::is_file(rpcs3::utils::get_custom_input_config_path(game.serial));
|
||||
const bool has_hover_gif = fs::is_file(game_icon_path + game.serial + "/hover.gif");
|
||||
|
||||
@ -1017,15 +1017,10 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
|
||||
QAction* open_config_dir = menu.addAction(tr("&Open Custom Config Folder"));
|
||||
connect(open_config_dir, &QAction::triggered, [current_game]()
|
||||
{
|
||||
const std::string new_config_path = rpcs3::utils::get_custom_config_path(current_game.serial);
|
||||
const std::string config_path = rpcs3::utils::get_custom_config_path(current_game.serial);
|
||||
|
||||
if (fs::is_file(new_config_path))
|
||||
gui::utils::open_dir(new_config_path);
|
||||
|
||||
const std::string old_config_path = rpcs3::utils::get_custom_config_path(current_game.serial, true);
|
||||
|
||||
if (fs::is_file(old_config_path))
|
||||
gui::utils::open_dir(old_config_path);
|
||||
if (fs::is_file(config_path))
|
||||
gui::utils::open_dir(config_path);
|
||||
});
|
||||
}
|
||||
if (fs::is_dir(data_base_dir))
|
||||
@ -1398,10 +1393,9 @@ bool game_list_frame::CreatePPUCache(const game_info& game)
|
||||
|
||||
bool game_list_frame::RemoveCustomConfiguration(const std::string& title_id, const game_info& game, bool is_interactive)
|
||||
{
|
||||
const std::string config_path_new = rpcs3::utils::get_custom_config_path(title_id);
|
||||
const std::string config_path_old = rpcs3::utils::get_custom_config_path(title_id, true);
|
||||
const std::string path = rpcs3::utils::get_custom_config_path(title_id);
|
||||
|
||||
if (!fs::is_file(config_path_new) && !fs::is_file(config_path_old))
|
||||
if (!fs::is_file(path))
|
||||
return true;
|
||||
|
||||
if (is_interactive && QMessageBox::question(this, tr("Confirm Removal"), tr("Remove custom game configuration?")) != QMessageBox::Yes)
|
||||
@ -1409,12 +1403,8 @@ bool game_list_frame::RemoveCustomConfiguration(const std::string& title_id, con
|
||||
|
||||
bool result = true;
|
||||
|
||||
for (const std::string& path : { config_path_new, config_path_old })
|
||||
if (fs::is_file(path))
|
||||
{
|
||||
if (!fs::is_file(path))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (fs::remove_file(path))
|
||||
{
|
||||
if (game)
|
||||
|
Loading…
Reference in New Issue
Block a user