From a5e35e7193b32b26a938fb22e6d6f00640d2d23e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 12 Jan 2018 03:54:51 +0100 Subject: [PATCH] ake --- menu/menu_displaylist.c | 43 +++++++++++++++-------------------------- menu/menu_displaylist.h | 1 + 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 985cf363c5..b9f7e9b0b6 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -1258,11 +1258,7 @@ static int menu_displaylist_parse_playlist(menu_displaylist_info_t *info, if (list_size == 0) { - menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE), - msg_hash_to_str(MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE), - MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE, - MENU_INFO_MESSAGE, 0, 0); + info->need_push_no_playlist_entries = true; return 0; } @@ -1972,11 +1968,7 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info) } if (db_info->count < 1) - menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE), - msg_hash_to_str(MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE), - MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE, - 0, 0, 0); + info->need_push_no_playlist_entries = true; playlist_free(playlist); database_info_list_free(db_info); @@ -3810,14 +3802,7 @@ static bool menu_displaylist_push_internal( MENU_ENUM_LABEL_TAKE_SCREENSHOT, MENU_SETTING_ACTION_SCREENSHOT, 0, 0); else - menu_entries_append_enum(info->list, - msg_hash_to_str( - MENU_ENUM_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE), - msg_hash_to_str( - MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE), - MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE, - MENU_INFO_MESSAGE, 0, 0); - + info->need_push_no_playlist_entries = true; #endif menu_displaylist_ctl(DISPLAYLIST_IMAGES_HISTORY, info); return true; @@ -3842,15 +3827,9 @@ static bool menu_displaylist_push_internal( if (string_is_empty(settings->paths.directory_playlist)) { menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list); - menu_entries_append_enum(info->list, - msg_hash_to_str( - MENU_ENUM_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE), - msg_hash_to_str( - MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE), - MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE, - MENU_INFO_MESSAGE, 0, 0); - info->need_refresh = true; - info->need_push = true; + info->need_refresh = true; + info->need_push_no_playlist_entries = true; + info->need_push = true; return true; } @@ -4082,6 +4061,15 @@ bool menu_displaylist_process(menu_displaylist_info_t *info) if (info->need_push) { + if (info->need_push_no_playlist_entries) + menu_entries_append_enum(info->list, + msg_hash_to_str( + MENU_ENUM_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE), + msg_hash_to_str( + MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE), + MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE, + MENU_INFO_MESSAGE, 0, 0); + if (!string_is_empty(info->label)) info->label_hash = msg_hash_calculate(info->label); menu_driver_populate_entries(info); @@ -4120,6 +4108,7 @@ void menu_displaylist_info_init(menu_displaylist_info_t *info) info->need_sort = false; info->need_refresh = false; info->need_entries_refresh = false; + info->need_push_no_playlist_entries = false; info->need_push = false; info->need_clear = false; info->push_builtin_cores = false; diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h index 690c0d51cd..f8aea176c6 100644 --- a/menu/menu_displaylist.h +++ b/menu/menu_displaylist.h @@ -174,6 +174,7 @@ typedef struct menu_displaylist_info bool need_refresh; bool need_entries_refresh; bool need_push; + bool need_push_no_playlist_entries; /* should we clear the displaylist before we push * entries onto it? */ bool need_clear;