diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index e4a9d6c725..d4c8f36eca 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -1108,11 +1108,11 @@ static void mui_navigation_alphabet(size_t *unused) mui_navigation_set(true); } -static void mui_populate_entries(const char *path, +static void mui_populate_entries( + void *data, const char *path, const char *label, unsigned i) { - menu_handle_t *menu = menu_driver_get_ptr(); - mui_handle_t *mui = menu ? (mui_handle_t*)menu->userdata : NULL; + mui_handle_t *mui = (mui_handle_t*)data; if (!mui) return; diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 7f723e4012..04107cc19a 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -781,7 +781,8 @@ static void rgui_navigation_ascend_alphabet(size_t *unused) rgui_navigation_set(true); } -static void rgui_populate_entries(const char *path, +static void rgui_populate_entries(void *data, + const char *path, const char *label, unsigned k) { rgui_navigation_set(true); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index ea89379247..2f8be5def5 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1182,17 +1182,12 @@ static void xmb_list_open(xmb_handle_t *xmb) xmb->old_depth = xmb->depth; } -static void xmb_populate_entries(const char *path, +static void xmb_populate_entries(void *data, + const char *path, const char *label, unsigned k) { - xmb_handle_t *xmb = NULL; - menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); - - if (!menu) - return; - - xmb = (xmb_handle_t*)menu->userdata; + xmb_handle_t *xmb = (xmb_handle_t*)data; if (!xmb) return; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index d2b008a6b2..80c6376a53 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3195,6 +3195,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type) void menu_displaylist_push_list_process(menu_displaylist_info_t *info) { + if (!info) return; @@ -3207,9 +3208,10 @@ void menu_displaylist_push_list_process(menu_displaylist_info_t *info) if (info->need_push) { const menu_ctx_driver_t *menu_driver = menu_ctx_driver_get_ptr(); + menu_handle_t *menu = menu_driver_get_ptr(); - if (menu_driver->populate_entries) - menu_driver->populate_entries(info->path, info->label, info->type); + if (menu && menu_driver->populate_entries) + menu_driver->populate_entries(menu->userdata, info->path, info->label, info->type); ui_companion_driver_notify_list_loaded(info->list, info->menu_list); } diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 1499d29ead..e2f867b68e 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -257,7 +257,8 @@ typedef struct menu_ctx_driver void (*free)(void*); void (*context_reset)(void); void (*context_destroy)(void); - void (*populate_entries)(const char *path, const char *label, + void (*populate_entries)(void *data, + const char *path, const char *label, unsigned k); void (*toggle)(bool); void (*navigation_clear)(bool);