(menu_displaylist) Add SL_FLAG_ALLOW_EMPTY_LIST

This commit is contained in:
Higor Eurípedes 2015-06-10 09:08:10 -03:00
parent cee0f2bf46
commit ad9f0c4021
3 changed files with 9 additions and 3 deletions

View File

@ -1425,6 +1425,7 @@ static void xmb_init_horizontal_list(menu_handle_t *menu, xmb_handle_t *xmb)
info.menu_list = NULL;
info.type = 0;
info.type_default = MENU_FILE_PLAIN;
info.flags = SL_FLAG_ALLOW_EMPTY_LIST;
strlcpy(info.label, "content_collection_list", sizeof(info.label));
strlcpy(info.path, settings->playlist_directory, sizeof(info.path));
strlcpy(info.exts, "lpl", sizeof(info.exts));

View File

@ -1602,14 +1602,18 @@ static int menu_displaylist_parse_generic(menu_displaylist_info_t *info, bool *n
dir_list_sort(str_list, true);
list_size = str_list->size;
if (list_size <= 0)
{
menu_list_push(info->list,
"No items.", "", 0, 0);
if (!(info->flags & SL_FLAG_ALLOW_EMPTY_LIST))
{
menu_list_push(info->list,
"No items.", "", 0, 0);
}
string_list_free(str_list);
return 0;
}

View File

@ -98,6 +98,7 @@ enum setting_list_flags
SL_FLAG_LOGGING_OPTIONS = (1 << 25),
SL_FLAG_SAVING_OPTIONS = (1 << 26),
SL_FLAG_ALL = (1 << 27),
SL_FLAG_ALLOW_EMPTY_LIST = (1 << 28)
};
#define SL_FLAG_ALL_SETTINGS (SL_FLAG_ALL - SL_FLAG_MAIN_MENU)