Pass userdata variable to populate_entries

This commit is contained in:
twinaphex 2015-12-10 16:45:38 +01:00
parent 333ee443e3
commit 94248be657
5 changed files with 14 additions and 15 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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);