From 6419ed08ccb03f262ebf8c1db955b833b6587735 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 30 Jun 2020 03:30:41 +0200 Subject: [PATCH] We can now get rid of menu_setting_get_label --- menu/cbs/menu_cbs_get_value.c | 22 ++++++++++++++-------- menu/menu_setting.c | 29 ----------------------------- menu/menu_setting.h | 19 ------------------- 3 files changed, 14 insertions(+), 56 deletions(-) diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index f3de0a2ec9..72957f3621 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -1374,11 +1374,14 @@ static void menu_action_setting_disp_set_label_achievement_information( const char *path, char *s2, size_t len2) { - *s = '\0'; - *w = 2; + menu_file_list_cbs_t *cbs = list->list[i].actiondata; + rarch_setting_t *setting = cbs->setting; - menu_setting_get_label(list, s, - len, w, type, label, i); + *s = '\0'; + *w = 2; + + if (setting && setting->get_string_representation) + setting->get_string_representation(setting, s, len); strlcpy(s2, path, len2); } @@ -1466,11 +1469,14 @@ static void menu_action_setting_disp_set_label(file_list_t* list, const char *path, char *s2, size_t len2) { - *s = '\0'; - *w = 19; + menu_file_list_cbs_t *cbs = list->list[i].actiondata; + rarch_setting_t *setting = cbs->setting; - menu_setting_get_label(list, s, - len, w, type, label, i); + *s = '\0'; + *w = 19; + + if (setting && setting->get_string_representation) + setting->get_string_representation(setting, s, len); strlcpy(s2, path, len2); } diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 217b73a6d7..f98d343859 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -6577,35 +6577,6 @@ static void get_string_representation_bind_device(rarch_setting_t *setting, char strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISABLED), len); } -/** - * menu_setting_get_label: - * @list : File list on which to perform the search - * @s : String for the type to be represented on-screen as - * a label. - * @len : Size of @s - * @w : Width of the string (for text label representation - * purposes in the menu display driver). - * @type : Identifier of setting. - * @menu_label : Menu Label identifier of setting. - * @label : Label identifier of setting. - * @idx : Index identifier of setting. - * - * Get associated label of a setting. - **/ -void menu_setting_get_label(file_list_t *list, char *s, - size_t len, unsigned *w, unsigned type, - const char *menu_label, unsigned idx) -{ - rarch_setting_t *setting = NULL; - if (!list) - return; - - setting = menu_setting_find(list->list[idx].label); - - if (setting && setting->get_string_representation) - setting->get_string_representation(setting, s, len); -} - void general_read_handler(rarch_setting_t *setting) { settings_t *settings = config_get_ptr(); diff --git a/menu/menu_setting.h b/menu/menu_setting.h index 66934069e0..6c9de7ea44 100644 --- a/menu/menu_setting.h +++ b/menu/menu_setting.h @@ -102,25 +102,6 @@ rarch_setting_t *menu_setting_find_enum(enum msg_hash_enums enum_idx); **/ void menu_setting_get_string_representation(rarch_setting_t *setting, char *s, size_t len); -/** - * menu_setting_get_label: - * @list : File list on which to perform the search - * @s : String for the type to be represented on-screen as - * a label. - * @len : Size of @s. - * @w : Width of the string (for text label representation - * purposes in the menu display driver). - * @type : Identifier of setting. - * @menu_label : Menu Label identifier of setting. - * @label : Label identifier of setting. - * @idx : Index identifier of setting. - * - * Get associated label of a setting. - **/ -void menu_setting_get_label(file_list_t *list, char *s, - size_t len, unsigned *w, unsigned type, - const char *menu_label, unsigned idx); - int menu_action_handle_setting(rarch_setting_t *setting, unsigned type, unsigned action, bool wraparound);