diff --git a/menu/menu_cbs.c b/menu/menu_cbs.c index fb95789920..2a2bdcf636 100644 --- a/menu/menu_cbs.c +++ b/menu/menu_cbs.c @@ -34,16 +34,15 @@ static void menu_cbs_init_log(const char *entry_label, const char *bind_label, c } void menu_cbs_init(void *data, + menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx) { char elem0[PATH_MAX_LENGTH]; char elem1[PATH_MAX_LENGTH]; const char *repr_label = NULL; - rarch_setting_t *setting = NULL; struct string_list *str_list = NULL; const char *menu_label = NULL; - menu_file_list_cbs_t *cbs = NULL; int ret = 0; uint32_t label_hash = 0; uint32_t menu_label_hash = 0; @@ -51,16 +50,6 @@ void menu_cbs_init(void *data, if (!list) return; - cbs = (menu_file_list_cbs_t*)menu_list_get_actiondata_at_offset(list, idx); - - if (!cbs) - return; - - setting = menu_setting_find(label); - - if (setting) - cbs->setting = setting; - elem0[0] = '\0'; elem1[0] = '\0'; diff --git a/menu/menu_cbs.h b/menu/menu_cbs.h index 6a09258750..71f23b9c9b 100644 --- a/menu/menu_cbs.h +++ b/menu/menu_cbs.h @@ -190,6 +190,7 @@ int action_scan_file(const char *path, const char *label, unsigned type, size_t idx); void menu_cbs_init(void *data, + menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx); diff --git a/menu/menu_entries.c b/menu/menu_entries.c index 03284c5399..3c62ae887a 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -233,6 +233,7 @@ static void menu_list_push(file_list_t *list, size_t idx; const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr(); menu_file_list_cbs_t *cbs = NULL; + rarch_setting_t *setting = NULL; if (!list || !label) return; @@ -251,7 +252,12 @@ static void menu_list_push(file_list_t *list, return; file_list_set_actiondata(list, idx, cbs); - menu_cbs_init(list, path, label, type, idx); + + setting = menu_setting_find(label); + + cbs->setting = (setting) ? setting : NULL; + + menu_cbs_init(list, cbs, path, label, type, idx); } void menu_list_set_alt_at_offset(file_list_t *list, size_t idx, diff --git a/menu/menu_entry.c b/menu/menu_entry.c index 1e46eaeb39..b68dba8495 100644 --- a/menu/menu_entry.c +++ b/menu/menu_entry.c @@ -43,8 +43,6 @@ int menu_entry_go_back(void) return 0; } - - enum menu_entry_type menu_entry_get_type(uint32_t i) { rarch_setting_t *setting = menu_entries_get_setting(i);