config_replace - add bool argument

This commit is contained in:
twinaphex 2017-01-24 18:08:26 +01:00
parent e3842d4169
commit 4b476cfe5f
3 changed files with 14 additions and 11 deletions

View File

@ -3353,10 +3353,9 @@ bool config_save_overrides(int override_type)
/* Replaces currently loaded configuration file with
* another one. Will load a dummy core to flush state
* properly. */
bool config_replace(char *path)
bool config_replace(bool config_save_on_exit, char *path)
{
content_ctx_info_t content_info = {0};
settings_t *settings = config_get_ptr();
if (!path)
return false;
@ -3366,7 +3365,7 @@ bool config_replace(char *path)
if (string_is_equal(path, path_get(RARCH_PATH_CONFIG)))
return false;
if (settings->config_save_on_exit && !path_is_empty(RARCH_PATH_CONFIG))
if (config_save_on_exit && !path_is_empty(RARCH_PATH_CONFIG))
config_save_file(path_get(RARCH_PATH_CONFIG));
path_set(RARCH_PATH_CONFIG, path);

View File

@ -642,7 +642,7 @@ bool config_save_overrides(int override_type);
/* Replaces currently loaded configuration file with
* another one. Will load a dummy core to flush state
* properly. */
bool config_replace(char *path);
bool config_replace(bool config_save_on_exit, char *path);
bool config_init(void);

View File

@ -1088,14 +1088,18 @@ static int generic_action_ok(const char *path,
}
break;
case ACTION_OK_LOAD_CONFIG_FILE:
flush_type = MENU_SETTINGS;
menu_display_set_msg_force(true);
if (config_replace(action_path))
{
bool pending_push = false;
menu_navigation_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
ret = -1;
settings_t *settings = config_get_ptr();
flush_type = MENU_SETTINGS;
menu_display_set_msg_force(true);
if (config_replace(settings->config_save_on_exit, action_path))
{
bool pending_push = false;
menu_navigation_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
ret = -1;
}
}
break;
#ifdef HAVE_SHADER_MANAGER