From 2f988c300b1785f12f32635ba7808109120329fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 20 Oct 2014 19:54:55 +0200 Subject: [PATCH] (Menu) Make disp_set_label work with any file_list --- frontend/menu/disp/glui.c | 2 +- frontend/menu/disp/rgui.c | 2 +- frontend/menu/disp/shared.h | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/menu/disp/glui.c b/frontend/menu/disp/glui.c index 60d4be154a..1790938225 100644 --- a/frontend/menu/disp/glui.c +++ b/frontend/menu/disp/glui.c @@ -303,7 +303,7 @@ static void glui_frame(void) driver.menu->menu_list->selection_buf->list[i].label); (void)setting; - disp_set_label(&w, type, i, label, + disp_set_label(driver.menu->menu_list->selection_buf, &w, type, i, label, type_str, sizeof(type_str), entry_label, path, path_buf, sizeof(path_buf)); diff --git a/frontend/menu/disp/rgui.c b/frontend/menu/disp/rgui.c index 5364e48457..9e6e9a53b9 100644 --- a/frontend/menu/disp/rgui.c +++ b/frontend/menu/disp/rgui.c @@ -352,7 +352,7 @@ static void rgui_render(void) driver.menu->menu_list->selection_buf->list[i].label); (void)setting; - disp_set_label(&w, type, i, label, + disp_set_label(driver.menu->menu_list->selection_buf, &w, type, i, label, type_str, sizeof(type_str), entry_label, path, path_buf, sizeof(path_buf)); diff --git a/frontend/menu/disp/shared.h b/frontend/menu/disp/shared.h index fabacb042c..4da4dce9dc 100644 --- a/frontend/menu/disp/shared.h +++ b/frontend/menu/disp/shared.h @@ -129,7 +129,8 @@ static void get_title(const char *label, const char *dir, } } -static void disp_set_label(unsigned *w, unsigned type, unsigned i, +static void disp_set_label(file_list_t* list, + unsigned *w, unsigned type, unsigned i, const char *label, char *type_str, size_t type_str_size, const char *entry_label, @@ -148,7 +149,7 @@ static void disp_set_label(unsigned *w, unsigned type, unsigned i, if (type == MENU_FILE_CORE) { strlcpy(type_str, "(CORE)", type_str_size); - menu_list_get_alt_at_offset(driver.menu->menu_list->selection_buf, i, &path); + menu_list_get_alt_at_offset(list, i, &path); *w = 6; } else if (type == MENU_FILE_PLAIN)