mirror of
https://github.com/libretro/RetroArch.git
synced 2025-03-04 16:07:24 +00:00
(file_list.c) Add label set/get
This commit is contained in:
parent
236920a641
commit
c9f8ea5049
21
file_list.c
21
file_list.c
@ -103,6 +103,21 @@ void file_list_clear(file_list_t *list)
|
||||
list->size = 0;
|
||||
}
|
||||
|
||||
void file_list_set_label_at_offset(file_list_t *list, size_t index,
|
||||
const char *label)
|
||||
{
|
||||
free(list->list[index].label);
|
||||
list->list[index].label = strdup(label);
|
||||
}
|
||||
|
||||
void file_list_get_label_at_offset(const file_list_t *list, size_t index,
|
||||
const char **label)
|
||||
{
|
||||
if (label)
|
||||
*label = list->list[index].label ?
|
||||
list->list[index].label : list->list[index].path;
|
||||
}
|
||||
|
||||
void file_list_set_alt_at_offset(file_list_t *list, size_t index,
|
||||
const char *alt)
|
||||
{
|
||||
@ -162,7 +177,11 @@ bool file_list_search(const file_list_t *list, const char *needle, size_t *index
|
||||
const char *str;
|
||||
file_list_get_alt_at_offset(list, i, &alt);
|
||||
if (!alt)
|
||||
continue;
|
||||
{
|
||||
file_list_get_label_at_offset(list, i, &alt);
|
||||
if (!alt)
|
||||
continue;
|
||||
}
|
||||
|
||||
str = (const char *)strcasestr(alt, needle);
|
||||
if (str == alt)
|
||||
|
@ -59,6 +59,11 @@ void file_list_get_at_offset(const file_list_t *list, size_t index,
|
||||
const char **path, const char **label,
|
||||
unsigned *type);
|
||||
|
||||
void file_list_set_label_at_offset(file_list_t *list, size_t index,
|
||||
const char *label);
|
||||
void file_list_get_label_at_offset(const file_list_t *list, size_t index,
|
||||
const char **label);
|
||||
|
||||
void file_list_set_alt_at_offset(file_list_t *list, size_t index,
|
||||
const char *alt);
|
||||
void file_list_get_alt_at_offset(const file_list_t *list, size_t index,
|
||||
|
@ -1321,7 +1321,8 @@ static int menu_setting_ok_toggle(unsigned type,
|
||||
else if (type == MENU_SETTINGS_CUSTOM_VIEWPORT)
|
||||
{
|
||||
file_list_push(driver.menu->menu_stack, "", "",
|
||||
type, driver.menu->selection_ptr);
|
||||
MENU_SETTINGS_CUSTOM_VIEWPORT,
|
||||
driver.menu->selection_ptr);
|
||||
|
||||
/* Start with something sane. */
|
||||
rarch_viewport_t *custom = (rarch_viewport_t*)
|
||||
|
Loading…
x
Reference in New Issue
Block a user