mirror of
https://github.com/libretro/RetroArch
synced 2025-03-22 07:21:15 +00:00
Simplify core_info_list_get_all_extensions
This commit is contained in:
parent
ad1b433d57
commit
c8b041ef7d
10
core_info.c
10
core_info.c
@ -460,11 +460,13 @@ bool core_info_does_support_file(const core_info_t *core, const char *path)
|
||||
core->supported_extensions_list, ".", path_get_extension(path));
|
||||
}
|
||||
|
||||
const char *core_info_list_get_all_extensions(core_info_list_t *core_info_list)
|
||||
const char *core_info_list_get_all_extensions(void)
|
||||
{
|
||||
if (!core_info_list)
|
||||
return "";
|
||||
return core_info_list->all_ext;
|
||||
global_t *global = global_get_ptr();
|
||||
core_info_list_t *list = (global->core_info.list) ? global->core_info.list : NULL;
|
||||
if (!list)
|
||||
return NULL;
|
||||
return list->all_ext;
|
||||
}
|
||||
|
||||
/* qsort_r() is not in standard C, sadly. */
|
||||
|
@ -99,7 +99,7 @@ void core_info_list_update_missing_firmware(core_info_list_t *list,
|
||||
bool core_info_list_get_info(core_info_list_t *list,
|
||||
core_info_t *info, const char *path);
|
||||
|
||||
const char *core_info_list_get_all_extensions(core_info_list_t *list);
|
||||
const char *core_info_list_get_all_extensions(void);
|
||||
|
||||
bool core_info_list_get_display_name(core_info_list_t *list,
|
||||
const char *path, char *buf, size_t size);
|
||||
|
@ -25,7 +25,6 @@ struct string_list *dir_list_new_special(const char *input_dir, enum dir_list_ty
|
||||
const char *exts = NULL;
|
||||
bool include_dirs = false;
|
||||
|
||||
global_t *global = global_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
(void)input_dir;
|
||||
@ -39,7 +38,7 @@ struct string_list *dir_list_new_special(const char *input_dir, enum dir_list_ty
|
||||
break;
|
||||
case DIR_LIST_CORE_INFO:
|
||||
dir = input_dir;
|
||||
exts = (global->core_info.list) ? core_info_list_get_all_extensions(global->core_info.list) : NULL;
|
||||
exts = core_info_list_get_all_extensions();
|
||||
break;
|
||||
case DIR_LIST_SHADERS:
|
||||
dir = settings->video.shader_dir;
|
||||
|
@ -306,7 +306,8 @@ static int general_push(menu_displaylist_info_t *info, unsigned id, unsigned typ
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
const char *exts = core_info_list_get_all_extensions();
|
||||
|
||||
switch (id)
|
||||
{
|
||||
@ -327,9 +328,9 @@ static int general_push(menu_displaylist_info_t *info, unsigned id, unsigned typ
|
||||
{
|
||||
case PUSH_ARCHIVE_OPEN_DETECT_CORE:
|
||||
info->setting = menu_setting_find(info->label);
|
||||
if (global->core_info.list)
|
||||
strlcpy(info->exts, core_info_list_get_all_extensions(
|
||||
global->core_info.list), sizeof(info->exts));
|
||||
|
||||
if (exts)
|
||||
strlcpy(info->exts, exts, sizeof(info->exts));
|
||||
else if (global->menu.info.valid_extensions)
|
||||
{
|
||||
if (*global->menu.info.valid_extensions)
|
||||
@ -363,9 +364,8 @@ static int general_push(menu_displaylist_info_t *info, unsigned id, unsigned typ
|
||||
strlcpy(info->exts, system->valid_extensions, sizeof(info->exts));
|
||||
break;
|
||||
case PUSH_DETECT_CORE_LIST:
|
||||
if (global->core_info.list)
|
||||
strlcpy(info->exts, core_info_list_get_all_extensions(
|
||||
global->core_info.list), sizeof(info->exts));
|
||||
if (exts)
|
||||
strlcpy(info->exts, exts, sizeof(info->exts));
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user