Create MENU_ENTRIES_CTL_CLEAR

This commit is contained in:
twinaphex 2016-02-24 22:45:21 +01:00
parent 1c06843811
commit e8a5f6194e
5 changed files with 13 additions and 8 deletions

View File

@ -1368,7 +1368,7 @@ static int mui_list_push(void *data, void *userdata,
switch (type)
{
case DISPLAYLIST_LOAD_CONTENT_LIST:
menu_entries_clear(info->list);
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
menu_entries_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_LOAD_CONTENT),
menu_hash_to_str(MENU_LABEL_LOAD_CONTENT),
@ -1393,7 +1393,7 @@ static int mui_list_push(void *data, void *userdata,
ret = 0;
break;
case DISPLAYLIST_MAIN_MENU:
menu_entries_clear(info->list);
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{

View File

@ -2731,7 +2731,7 @@ static int xmb_list_push(void *data, void *userdata,
switch (type)
{
case DISPLAYLIST_MAIN_MENU:
menu_entries_clear(info->list);
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{

View File

@ -2661,7 +2661,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
case DISPLAYLIST_CONTENT_HISTORY:
case DISPLAYLIST_ARCHIVE_ACTION:
case DISPLAYLIST_ARCHIVE_ACTION_DETECT_CORE:
menu_entries_clear(info->list);
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
break;
}
@ -3496,7 +3496,7 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
if (string_is_empty(settings->playlist_directory))
{
menu_entries_clear(info.list);
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info.list);
menu_entries_push(info.list,
menu_hash_to_str(MENU_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE),
menu_hash_to_str(MENU_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE),

View File

@ -233,9 +233,11 @@ static void menu_list_flush_stack(menu_list_t *list,
}
}
void menu_entries_clear(file_list_t *list)
static bool menu_entries_clear(file_list_t *list)
{
unsigned i;
if (!list)
return false;
menu_driver_ctl(RARCH_MENU_CTL_LIST_CLEAR, list);
@ -244,6 +246,8 @@ void menu_entries_clear(file_list_t *list)
if (list)
file_list_clear(list);
return true;
}
void menu_entries_set_alt_at_offset(file_list_t *list, size_t idx,
@ -723,6 +727,8 @@ bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
break;
case MENU_ENTRIES_CTL_REFRESH:
return menu_entries_refresh(data);
case MENU_ENTRIES_CTL_CLEAR:
return menu_entries_clear((file_list_t*)data);
case MENU_ENTRIES_CTL_INIT:
return menu_entries_init();
case MENU_ENTRIES_CTL_SHOW_BACK:

View File

@ -120,6 +120,7 @@ enum menu_entries_ctl_state
/* Returns the starting index of the menu entry list. */
MENU_ENTRIES_CTL_START_GET,
MENU_ENTRIES_CTL_REFRESH,
MENU_ENTRIES_CTL_CLEAR,
MENU_ENTRIES_CTL_SHOW_BACK
};
@ -167,8 +168,6 @@ void menu_entries_get_last(const file_list_t *list,
const char **path, const char **label,
unsigned *file_type, size_t *entry_idx);
void menu_entries_clear(file_list_t *list);
void menu_entries_set_alt_at_offset(file_list_t *list, size_t idx,
const char *alt);