From 9bce38426c96b3aebc004e5cfdd0bc98f057b706 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 17 Oct 2014 23:43:53 +0200 Subject: [PATCH] Add menu_list_set_alt_at_offset and menu_list_get_alt_at_offset --- frontend/menu/menu_entries.c | 4 ++-- frontend/menu/menu_entries_cbs.c | 2 +- frontend/menu/menu_list.c | 12 ++++++++++++ frontend/menu/menu_list.h | 6 ++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/frontend/menu/menu_entries.c b/frontend/menu/menu_entries.c index 995a01f30f..ede4bf2307 100644 --- a/frontend/menu/menu_entries.c +++ b/frontend/menu/menu_entries.c @@ -56,7 +56,7 @@ static inline int entries_list_get_first_char(file_list_t *buf, int ret; const char *path = NULL; - file_list_get_alt_at_offset(buf, offset, &path); + menu_list_get_alt_at_offset(buf, offset, &path); ret = tolower(*path); /* "Normalize" non-alphabetical entries so they @@ -360,7 +360,7 @@ int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list, if (g_extern.core_info && core_info_list_get_display_name(g_extern.core_info, core_path, display_name, sizeof(display_name))) - file_list_set_alt_at_offset(list, i, display_name); + menu_list_set_alt_at_offset(list, i, display_name); } file_list_sort_on_alt(list); } diff --git a/frontend/menu/menu_entries_cbs.c b/frontend/menu/menu_entries_cbs.c index 1a54042fa9..8a1efb90bb 100644 --- a/frontend/menu/menu_entries_cbs.c +++ b/frontend/menu/menu_entries_cbs.c @@ -1473,7 +1473,7 @@ static int deferred_push_core_list_deferred(void *data, void *userdata, { menu_list_push(list, info[i].path, "", MENU_FILE_CORE, 0); - file_list_set_alt_at_offset(list, i, + menu_list_set_alt_at_offset(list, i, info[i].display_name); } diff --git a/frontend/menu/menu_list.c b/frontend/menu/menu_list.c index 7c0af55953..b3ae71c03a 100644 --- a/frontend/menu/menu_list.c +++ b/frontend/menu/menu_list.c @@ -250,3 +250,15 @@ void menu_list_push_stack_refresh(file_list_t *list, menu_navigation_clear(driver.menu, true); driver.menu->need_refresh = true; } + +void menu_list_set_alt_at_offset(file_list_t *list, size_t index, + const char *alt) +{ + file_list_set_alt_at_offset(list, index, alt); +} + +void menu_list_get_alt_at_offset(const file_list_t *list, size_t index, + const char **alt) +{ + file_list_get_alt_at_offset(list, index, alt); +} diff --git a/frontend/menu/menu_list.h b/frontend/menu/menu_list.h index 15d8fc7104..720ccd38f0 100644 --- a/frontend/menu/menu_list.h +++ b/frontend/menu/menu_list.h @@ -75,6 +75,12 @@ void menu_list_push_stack_refresh(file_list_t *list, const char *path, const char *label, unsigned type, size_t directory_ptr); +void menu_list_get_alt_at_offset(const file_list_t *list, size_t index, + const char **alt); + +void menu_list_set_alt_at_offset(file_list_t *list, size_t index, + const char *alt); + #ifdef __cplusplus } #endif