mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 02:43:03 +00:00
Rewrite path_b and path_c
This commit is contained in:
parent
72f42b602f
commit
72087d1749
@ -282,8 +282,13 @@ static int deferred_push_core_collection_list_deferred(
|
|||||||
static int deferred_push_database_manager_list_deferred(
|
static int deferred_push_database_manager_list_deferred(
|
||||||
menu_displaylist_info_t *info)
|
menu_displaylist_info_t *info)
|
||||||
{
|
{
|
||||||
strlcpy(info->path_b, info->path, sizeof(info->path_b));
|
if (info->path_b && !string_is_empty(info->path_b))
|
||||||
info->path_c[0] = '\0';
|
free(info->path_b);
|
||||||
|
if (info->path_c && !string_is_empty(info->path_c))
|
||||||
|
free(info->path_c);
|
||||||
|
|
||||||
|
info->path_b = strdup(info->path);
|
||||||
|
info->path_c = NULL;
|
||||||
|
|
||||||
return deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
|
return deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
|
||||||
}
|
}
|
||||||
@ -458,9 +463,15 @@ static int deferred_push_cursor_manager_list_deferred(
|
|||||||
settings->paths.path_content_database,
|
settings->paths.path_content_database,
|
||||||
rdb, sizeof(rdb_path));
|
rdb, sizeof(rdb_path));
|
||||||
|
|
||||||
strlcpy(info->path_b, info->path, sizeof(info->path_b));
|
if (info->path_b && !string_is_empty(info->path_b))
|
||||||
|
free(info->path_b);
|
||||||
|
if (info->path_c && !string_is_empty(info->path_c))
|
||||||
|
free(info->path_c);
|
||||||
|
|
||||||
|
info->path_b = strdup(info->path);
|
||||||
|
info->path_c = strdup(query);
|
||||||
|
|
||||||
strlcpy(info->path, rdb_path, sizeof(info->path));
|
strlcpy(info->path, rdb_path, sizeof(info->path));
|
||||||
strlcpy(info->path_c, query, sizeof(info->path_c));
|
|
||||||
|
|
||||||
ret = deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
|
ret = deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
|
||||||
|
|
||||||
@ -488,9 +499,15 @@ static int deferred_push_cursor_manager_list_generic(
|
|||||||
if (string_is_empty(query))
|
if (string_is_empty(query))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
if (info->path_b && !string_is_empty(info->path_b))
|
||||||
|
free(info->path_b);
|
||||||
|
if (info->path_c && !string_is_empty(info->path_c))
|
||||||
|
free(info->path_c);
|
||||||
|
|
||||||
strlcpy(info->path, str_list->elems[1].data, sizeof(info->path));
|
strlcpy(info->path, str_list->elems[1].data, sizeof(info->path));
|
||||||
strlcpy(info->path_b, str_list->elems[0].data, sizeof(info->path_b));
|
|
||||||
strlcpy(info->path_c, query, sizeof(info->path_c));
|
info->path_b = strdup(str_list->elems[0].data);
|
||||||
|
info->path_c = strdup(query);
|
||||||
|
|
||||||
ret = deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
|
ret = deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
|
||||||
|
|
||||||
@ -614,8 +631,14 @@ static int deferred_push_cursor_manager_list_deferred_query_subsearch(
|
|||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
strlcpy(info->path, str_list->elems[1].data, sizeof(info->path));
|
strlcpy(info->path, str_list->elems[1].data, sizeof(info->path));
|
||||||
strlcpy(info->path_b, str_list->elems[0].data, sizeof(info->path_b));
|
|
||||||
strlcpy(info->path_c, query, sizeof(info->path_c));
|
if (info->path_b && !string_is_empty(info->path_b))
|
||||||
|
free(info->path_b);
|
||||||
|
info->path_b = strdup(str_list->elems[0].data);
|
||||||
|
|
||||||
|
if (info->path_c && !string_is_empty(info->path_c))
|
||||||
|
free(info->path_c);
|
||||||
|
info->path_c = strdup(query);
|
||||||
|
|
||||||
ret = deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
|
ret = deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
|
||||||
|
|
||||||
|
@ -4313,19 +4313,19 @@ void menu_displaylist_info_free(menu_displaylist_info_t *info)
|
|||||||
return;
|
return;
|
||||||
if (info->exts)
|
if (info->exts)
|
||||||
free(info->exts);
|
free(info->exts);
|
||||||
info->exts = NULL;
|
|
||||||
#if 0
|
|
||||||
if (info->path)
|
|
||||||
free(info->path);
|
|
||||||
if (info->path_b)
|
if (info->path_b)
|
||||||
free(info->path_b);
|
free(info->path_b);
|
||||||
if (info->path_c)
|
if (info->path_c)
|
||||||
free(info->path_c);
|
free(info->path_c);
|
||||||
|
info->exts = NULL;
|
||||||
|
info->path_b = NULL;
|
||||||
|
info->path_c = NULL;
|
||||||
|
#if 0
|
||||||
|
if (info->path)
|
||||||
|
free(info->path);
|
||||||
if (info->label)
|
if (info->label)
|
||||||
free(info->label);
|
free(info->label);
|
||||||
info->path = NULL;
|
info->path = NULL;
|
||||||
info->path_b = NULL;
|
|
||||||
info->path_c = NULL;
|
|
||||||
info->label = NULL;
|
info->label = NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -4345,14 +4345,14 @@ void menu_displaylist_info_init(menu_displaylist_info_t *info)
|
|||||||
info->download_core = false;
|
info->download_core = false;
|
||||||
info->need_navigation_clear = false;
|
info->need_navigation_clear = false;
|
||||||
info->path[0] = '\0';
|
info->path[0] = '\0';
|
||||||
info->path_b[0] = '\0';
|
|
||||||
info->path_c[0] = '\0';
|
|
||||||
info->label[0] = '\0';
|
info->label[0] = '\0';
|
||||||
info->type = 0;
|
info->type = 0;
|
||||||
info->type_default = 0;
|
info->type_default = 0;
|
||||||
info->flags = 0;
|
info->flags = 0;
|
||||||
info->label_hash = 0;
|
info->label_hash = 0;
|
||||||
info->directory_ptr = 0;
|
info->directory_ptr = 0;
|
||||||
|
info->path_b = NULL;
|
||||||
|
info->path_c = NULL;
|
||||||
info->exts = NULL;
|
info->exts = NULL;
|
||||||
info->list = NULL;
|
info->list = NULL;
|
||||||
info->menu_list = NULL;
|
info->menu_list = NULL;
|
||||||
|
@ -185,8 +185,8 @@ typedef struct menu_displaylist_info
|
|||||||
bool need_navigation_clear;
|
bool need_navigation_clear;
|
||||||
|
|
||||||
char path[PATH_MAX_LENGTH];
|
char path[PATH_MAX_LENGTH];
|
||||||
char path_b[PATH_MAX_LENGTH];
|
char *path_b;
|
||||||
char path_c[PATH_MAX_LENGTH];
|
char *path_c;
|
||||||
char *exts;
|
char *exts;
|
||||||
char label[255];
|
char label[255];
|
||||||
unsigned type;
|
unsigned type;
|
||||||
|
@ -259,26 +259,10 @@ void menu_dialog_push(void)
|
|||||||
if (!menu_dialog_is_push_pending())
|
if (!menu_dialog_is_push_pending())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
info.need_sort = false;
|
menu_displaylist_info_init(&info);
|
||||||
info.need_refresh = false;
|
|
||||||
info.need_entries_refresh = false;
|
|
||||||
info.need_push = false;
|
|
||||||
info.need_clear = false;
|
|
||||||
info.need_navigation_clear= false;
|
|
||||||
info.list = menu_entries_get_menu_stack_ptr(0);
|
info.list = menu_entries_get_menu_stack_ptr(0);
|
||||||
info.menu_list = NULL;
|
|
||||||
info.path[0] = '\0';
|
|
||||||
info.path_b[0] = '\0';
|
|
||||||
info.path_c[0] = '\0';
|
|
||||||
info.label[0] = '\0';
|
|
||||||
info.label_hash = 0;
|
|
||||||
info.exts = NULL;
|
|
||||||
info.type = 0;
|
|
||||||
info.type_default = 0;
|
|
||||||
info.directory_ptr = 0;
|
|
||||||
info.flags = 0;
|
|
||||||
info.enum_idx = MENU_ENUM_LABEL_HELP;
|
info.enum_idx = MENU_ENUM_LABEL_HELP;
|
||||||
info.setting = NULL;
|
|
||||||
|
|
||||||
strlcpy(info.label,
|
strlcpy(info.label,
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_HELP),
|
msg_hash_to_str(MENU_ENUM_LABEL_HELP),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user