(XMB) Set fullpath dir for each node entry

This commit is contained in:
twinaphex 2017-01-07 18:32:40 +01:00
parent 51504286be
commit 9d9a5e71ab
5 changed files with 46 additions and 13 deletions

View File

@ -83,6 +83,7 @@ typedef struct
float y;
uintptr_t icon;
uintptr_t content_icon;
char fullpath[4096];
} xmb_node_t;
enum
@ -3520,7 +3521,10 @@ static void xmb_navigation_alphabet(void *data, size_t *unused)
static void xmb_list_insert(void *userdata,
file_list_t *list,
const char *path, const char *unused, size_t list_size)
const char *path,
const char *fullpath,
const char *unused,
size_t list_size)
{
size_t selection;
int current = 0;
@ -3545,6 +3549,10 @@ static void xmb_list_insert(void *userdata,
}
current = selection;
if (!string_is_empty(fullpath))
strlcpy(node->fullpath, fullpath, sizeof(node->fullpath));
node->alpha = xmb->items.passive.alpha;
node->zoom = xmb->items.passive.zoom;
node->label_alpha = node->alpha;

View File

@ -828,7 +828,8 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
if (!list || !menu_driver_ctx || !menu_driver_ctx->list_insert)
return false;
menu_driver_ctx->list_insert(menu_userdata,
list->list, list->path, list->label, list->idx);
list->list, list->path, list->fullpath,
list->label, list->idx);
}
break;
case RARCH_MENU_CTL_LOAD_IMAGE:

View File

@ -260,7 +260,7 @@ typedef struct menu_ctx_driver
void (*navigation_ascend_alphabet)(void *, size_t *);
bool (*lists_init)(void*);
void (*list_insert)(void *userdata,
file_list_t *list, const char *, const char *, size_t);
file_list_t *list, const char *, const char *, const char *, size_t);
int (*list_prepend)(void *userdata,
file_list_t *list, const char *, const char *, size_t);
void (*list_free)(file_list_t *list, size_t, size_t);

View File

@ -341,21 +341,33 @@ void menu_entries_append(file_list_t *list, const char *path, const char *label,
{
menu_ctx_list_t list_info;
size_t idx;
const char *menu_path = NULL;
const char *menu_label = NULL;
menu_file_list_cbs_t *cbs = NULL;
if (!list || !label)
return;
file_list_append(list, path, label, type, directory_ptr, entry_idx);
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL, NULL);
idx = list->size - 1;
list_info.list = list;
list_info.path = path;
list_info.fullpath = NULL;
if (!string_is_empty(menu_path))
list_info.fullpath = strdup(menu_path);
list_info.label = label;
list_info.idx = idx;
menu_driver_ctl(RARCH_MENU_CTL_LIST_INSERT, &list_info);
if (list_info.fullpath)
free(list_info.fullpath);
file_list_free_actiondata(list, idx);
cbs = (menu_file_list_cbs_t*)
calloc(1, sizeof(menu_file_list_cbs_t));
@ -377,14 +389,22 @@ void menu_entries_append_enum(file_list_t *list, const char *path, const char *l
{
menu_ctx_list_t list_info;
size_t idx;
const char *menu_path = NULL;
const char *menu_label = NULL;
menu_file_list_cbs_t *cbs = NULL;
if (!list || !label)
return;
file_list_append(list, path, label, type, directory_ptr, entry_idx);
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL, NULL);
idx = list->size - 1;
list_info.fullpath = NULL;
if (!string_is_empty(menu_path))
list_info.fullpath = strdup(menu_path);
list_info.list = list;
list_info.path = path;
list_info.label = label;
@ -392,6 +412,9 @@ void menu_entries_append_enum(file_list_t *list, const char *path, const char *l
menu_driver_ctl(RARCH_MENU_CTL_LIST_INSERT, &list_info);
if (list_info.fullpath)
free(list_info.fullpath);
file_list_free_actiondata(list, idx);
cbs = (menu_file_list_cbs_t*)
calloc(1, sizeof(menu_file_list_cbs_t));

View File

@ -39,6 +39,7 @@ typedef struct menu_ctx_list
file_list_t *list;
size_t list_size;
const char *path;
char *fullpath;
const char *label;
size_t idx;
enum menu_list_type type;