From 307a7a9b1e529c1497587e059ee6283eaf17acad Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 26 Oct 2016 05:30:45 +0200 Subject: [PATCH] Update / simplify CONFIG_PATH --- menu/menu_setting.c | 32 ++++++++++++++++---------------- setting_list.c | 10 +++++++--- setting_list.h | 3 ++- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 6bc77b6280..86d29bc176 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -3753,8 +3753,8 @@ static bool setting_append_list( list, list_info, settings->path.softfilter_plugin, sizeof(settings->path.softfilter_plugin), - msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_FILTER), - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER), + MENU_ENUM_LABEL_VIDEO_FILTER, + MENU_ENUM_LABEL_VALUE_VIDEO_FILTER, settings->directory.video_filter, &group_info, &subgroup_info, @@ -4000,8 +4000,8 @@ static bool setting_append_list( list, list_info, settings->path.audio_dsp_plugin, sizeof(settings->path.audio_dsp_plugin), - msg_hash_to_str(MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN), - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AUDIO_DSP_PLUGIN), + MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN, + MENU_ENUM_LABEL_VALUE_AUDIO_DSP_PLUGIN, settings->directory.audio_filter, &group_info, &subgroup_info, @@ -4399,8 +4399,8 @@ static bool setting_append_list( list, list_info, global->record.config, sizeof(global->record.config), - msg_hash_to_str(MENU_ENUM_LABEL_RECORD_CONFIG), - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RECORD_CONFIG), + MENU_ENUM_LABEL_RECORD_CONFIG, + MENU_ENUM_LABEL_VALUE_RECORD_CONFIG, "", &group_info, &subgroup_info, @@ -4609,8 +4609,8 @@ static bool setting_append_list( list, list_info, settings->path.font, sizeof(settings->path.font), - msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_FONT_PATH), - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_PATH), + MENU_ENUM_LABEL_VIDEO_FONT_PATH, + MENU_ENUM_LABEL_VALUE_VIDEO_FONT_PATH, "", &group_info, &subgroup_info, @@ -4752,8 +4752,8 @@ static bool setting_append_list( list, list_info, settings->path.overlay, sizeof(settings->path.overlay), - msg_hash_to_str(MENU_ENUM_LABEL_OVERLAY_PRESET), - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OVERLAY_PRESET), + MENU_ENUM_LABEL_OVERLAY_PRESET, + MENU_ENUM_LABEL_VALUE_OVERLAY_PRESET, settings->directory.overlay, &group_info, &subgroup_info, @@ -4806,8 +4806,8 @@ static bool setting_append_list( list, list_info, settings->path.osk_overlay, sizeof(settings->path.osk_overlay), - msg_hash_to_str(MENU_ENUM_LABEL_KEYBOARD_OVERLAY_PRESET), - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_KEYBOARD_OVERLAY_PRESET), + MENU_ENUM_LABEL_KEYBOARD_OVERLAY_PRESET, + MENU_ENUM_LABEL_VALUE_KEYBOARD_OVERLAY_PRESET, dir_get_ptr(RARCH_DIR_OSK_OVERLAY), &group_info, &subgroup_info, @@ -4837,8 +4837,8 @@ static bool setting_append_list( list, list_info, settings->path.menu_wallpaper, sizeof(settings->path.menu_wallpaper), - msg_hash_to_str(MENU_ENUM_LABEL_MENU_WALLPAPER), - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MENU_WALLPAPER), + MENU_ENUM_LABEL_MENU_WALLPAPER, + MENU_ENUM_LABEL_VALUE_MENU_WALLPAPER, "", &group_info, &subgroup_info, @@ -5143,8 +5143,8 @@ static bool setting_append_list( list, list_info, settings->menu.xmb.font, sizeof(settings->menu.xmb.font), - msg_hash_to_str(MENU_ENUM_LABEL_XMB_FONT), - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_FONT), + MENU_ENUM_LABEL_XMB_FONT, + MENU_ENUM_LABEL_VALUE_XMB_FONT, settings->menu.xmb.font, &group_info, &subgroup_info, diff --git a/setting_list.c b/setting_list.c index 9cb65596ee..ecf384add8 100644 --- a/setting_list.c +++ b/setting_list.c @@ -1567,15 +1567,19 @@ bool CONFIG_PATH( rarch_setting_t **list, rarch_setting_info_t *list_info, char *target, size_t len, - const char *name, const char *SHORT, + enum msg_hash_enums name_enum_idx, + enum msg_hash_enums SHORT_enum_idx, const char *default_value, rarch_setting_group_info_t *group_info, rarch_setting_group_info_t *subgroup_info, const char *parent_group, change_handler_t change_handler, change_handler_t read_handler) { - rarch_setting_t value = setting_string_setting(ST_PATH, name, SHORT, target, len, default_value, "", - group_info->name, subgroup_info->name, parent_group, change_handler, read_handler); + rarch_setting_t value = setting_string_setting(ST_PATH, + msg_hash_to_str(name_enum_idx), + msg_hash_to_str(SHORT_enum_idx), + target, len, default_value, "", + group_info->name, subgroup_info->name, parent_group, change_handler, read_handler); if (!(settings_list_append(list, list_info))) return false; if (value.name) diff --git a/setting_list.h b/setting_list.h index 00d6f1d65e..230ba67264 100644 --- a/setting_list.h +++ b/setting_list.h @@ -289,7 +289,8 @@ bool CONFIG_PATH( rarch_setting_t **list, rarch_setting_info_t *list_info, char *target, size_t len, - const char *name, const char *SHORT, + enum msg_hash_enums name_enum_idx, + enum msg_hash_enums SHORT_enum_idx, const char *default_value, rarch_setting_group_info_t *group_info, rarch_setting_group_info_t *subgroup_info,