Cleanup command_event_save_current_config

This commit is contained in:
twinaphex 2017-01-01 05:36:18 +01:00
parent 92ca53db01
commit fa606ee479
1 changed files with 23 additions and 17 deletions

View File

@ -1591,13 +1591,19 @@ static bool command_event_save_core_config(void)
* Saves current configuration file to disk, and (optionally)
* autosave state.
**/
static void command_event_save_current_config(int override_type)
static void command_event_save_current_config(enum override_type type)
{
char msg[128] = {0};
if (override_type)
switch (type)
{
if (config_save_overrides(override_type))
case OVERRIDE_NONE:
if (!path_is_empty(RARCH_PATH_CONFIG))
command_event_save_config(path_get(RARCH_PATH_CONFIG), msg, sizeof(msg));
break;
case OVERRIDE_GAME:
case OVERRIDE_CORE:
if (config_save_overrides(type))
{
strlcpy(msg, msg_hash_to_str(MSG_OVERRIDES_SAVED_SUCCESSFULLY), sizeof(msg));
RARCH_LOG("[overrides] %s\n", msg);
@ -1611,9 +1617,9 @@ static void command_event_save_current_config(int override_type)
strlcpy(msg, msg_hash_to_str(MSG_OVERRIDES_ERROR_SAVING), sizeof(msg));
RARCH_ERR("[overrides] %s\n", msg);
}
break;
}
else if (!path_is_empty(RARCH_PATH_CONFIG))
command_event_save_config(path_get(RARCH_PATH_CONFIG), msg, sizeof(msg));
if (!string_is_empty(msg))
runloop_msg_queue_push(msg, 1, 180, true);