Create menu_driver_list_clear

This commit is contained in:
twinaphex 2017-04-23 21:13:33 +02:00
parent 467070f6a6
commit e0483f73bc
3 changed files with 13 additions and 11 deletions

View File

@ -436,6 +436,16 @@ bool menu_driver_iterate(menu_ctx_iterate_t *iterate)
return true;
}
bool menu_driver_list_clear(void *data)
{
file_list_t *list = (file_list_t*)data;
if (!list)
return false;
if (menu_driver_ctx->list_clear)
menu_driver_ctx->list_clear(list);
return true;
}
bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
{
switch (state)
@ -777,15 +787,6 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
return true;
}
return false;
case RARCH_MENU_CTL_LIST_CLEAR:
{
file_list_t *list = (file_list_t*)data;
if (!list)
return false;
if (menu_driver_ctx->list_clear)
menu_driver_ctx->list_clear(list);
}
break;
case RARCH_MENU_CTL_TOGGLE:
{
bool *on = (bool*)data;

View File

@ -120,7 +120,6 @@ enum rarch_menu_ctl_state
RARCH_MENU_CTL_FIND_DRIVER,
RARCH_MENU_CTL_LOAD_IMAGE,
RARCH_MENU_CTL_LIST_FREE,
RARCH_MENU_CTL_LIST_CLEAR,
RARCH_MENU_CTL_LIST_SET_SELECTION,
RARCH_MENU_CTL_LIST_GET_SELECTION,
RARCH_MENU_CTL_LIST_GET_SIZE,
@ -400,6 +399,8 @@ bool menu_driver_is_alive(void);
bool menu_driver_iterate(menu_ctx_iterate_t *iterate);
bool menu_driver_list_clear(void *data);
extern menu_ctx_driver_t menu_ctx_xui;
extern menu_ctx_driver_t menu_ctx_rgui;
extern menu_ctx_driver_t menu_ctx_mui;

View File

@ -68,7 +68,7 @@ static bool menu_entries_clear(file_list_t *list)
if (!list)
return false;
menu_driver_ctl(RARCH_MENU_CTL_LIST_CLEAR, list);
menu_driver_list_clear(list);
for (i = 0; i < list->size; i++)
file_list_free_actiondata(list, i);