mirror of
https://github.com/libretro/RetroArch.git
synced 2024-06-02 19:57:24 -04:00
dir_list_new_special - no more dependency on settings_t
This commit is contained in:
parent
172f75e5c0
commit
de604a79ab
|
@ -59,7 +59,8 @@ enum string_list_type
|
|||
};
|
||||
|
||||
struct string_list *dir_list_new_special(const char *input_dir,
|
||||
enum dir_list_type type, const char *filter);
|
||||
enum dir_list_type type, const char *filter,
|
||||
bool show_hidden_files);
|
||||
|
||||
struct string_list *string_list_new_special(enum string_list_type type,
|
||||
void *data, unsigned *len, size_t *list_size);
|
||||
|
|
|
@ -548,7 +548,7 @@ bool manual_content_scan_get_menu_core_name(const char **core_name)
|
|||
* > Returns NULL in the event of failure
|
||||
* > Returned string list must be free()'d */
|
||||
struct string_list *manual_content_scan_get_menu_system_name_list(
|
||||
const char *path_content_database)
|
||||
const char *path_content_database, bool show_hidden_files)
|
||||
{
|
||||
union string_list_elem_attr attr;
|
||||
struct string_list *name_list = string_list_new();
|
||||
|
@ -579,7 +579,7 @@ struct string_list *manual_content_scan_get_menu_system_name_list(
|
|||
* or verify file extensions) */
|
||||
struct string_list *rdb_list = dir_list_new_special(
|
||||
path_content_database,
|
||||
DIR_LIST_DATABASES, NULL);
|
||||
DIR_LIST_DATABASES, NULL, show_hidden_files);
|
||||
|
||||
if (rdb_list && rdb_list->size)
|
||||
{
|
||||
|
|
|
@ -195,7 +195,7 @@ bool manual_content_scan_get_menu_core_name(const char **core_name);
|
|||
* > Returns NULL in the event of failure
|
||||
* > Returned string list must be free()'d */
|
||||
struct string_list *manual_content_scan_get_menu_system_name_list(
|
||||
const char *path_content_database);
|
||||
const char *path_content_database, bool show_hidden_files);
|
||||
|
||||
/* Creates a list of all possible 'core name' menu
|
||||
* strings, for use in 'menu_displaylist' drop-down
|
||||
|
|
|
@ -527,7 +527,7 @@ static int manual_content_scan_system_name_left(unsigned type, const char *label
|
|||
#ifdef HAVE_LIBRETRODB
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(settings->paths.path_content_database);
|
||||
manual_content_scan_get_menu_system_name_list(settings->paths.path_content_database, settings->bools.show_hidden_files);
|
||||
#else
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(NULL);
|
||||
|
|
|
@ -614,10 +614,13 @@ static int manual_content_scan_system_name_right(unsigned type, const char *labe
|
|||
#ifdef HAVE_LIBRETRODB
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(settings->paths.path_content_database);
|
||||
manual_content_scan_get_menu_system_name_list(
|
||||
settings->paths.path_content_database,
|
||||
settings->bools.show_hidden_files);
|
||||
#else
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(NULL);
|
||||
manual_content_scan_get_menu_system_name_list(NULL,
|
||||
settings->bools.show_hidden_files);
|
||||
#endif
|
||||
const char *current_system_name = NULL;
|
||||
enum manual_content_scan_system_name_type next_system_name_type =
|
||||
|
|
|
@ -2739,7 +2739,8 @@ static unsigned menu_displaylist_parse_playlist_manager_list(
|
|||
/* Add collection playlists */
|
||||
str_list = dir_list_new_special(
|
||||
settings->paths.directory_playlist,
|
||||
DIR_LIST_COLLECTIONS, NULL);
|
||||
DIR_LIST_COLLECTIONS, NULL,
|
||||
settings->bools.show_hidden_files);
|
||||
|
||||
if (str_list && str_list->size)
|
||||
{
|
||||
|
@ -2942,7 +2943,8 @@ static unsigned menu_displaylist_parse_pl_thumbnail_download_list(
|
|||
|
||||
str_list = dir_list_new_special(
|
||||
settings->paths.directory_playlist,
|
||||
DIR_LIST_COLLECTIONS, NULL);
|
||||
DIR_LIST_COLLECTIONS, NULL,
|
||||
settings->bools.show_hidden_files);
|
||||
|
||||
if (str_list && str_list->size)
|
||||
{
|
||||
|
@ -5292,10 +5294,10 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
|||
#ifdef HAVE_LIBRETRODB
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(settings->paths.path_content_database);
|
||||
manual_content_scan_get_menu_system_name_list(settings->paths.path_content_database, settings->bools.show_hidden_files);
|
||||
#else
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(NULL);
|
||||
manual_content_scan_get_menu_system_name_list(NULL, settings->bools.show_hidden_files);
|
||||
#endif
|
||||
|
||||
if (system_name_list)
|
||||
|
|
12
retroarch.c
12
retroarch.c
|
@ -1229,7 +1229,8 @@ static void rarch_init_core_options(
|
|||
static void bsv_movie_set_path(const char *path);
|
||||
|
||||
struct string_list *dir_list_new_special(const char *input_dir,
|
||||
enum dir_list_type type, const char *filter)
|
||||
enum dir_list_type type, const char *filter,
|
||||
bool show_hidden_files)
|
||||
{
|
||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
||||
char ext_shaders[255];
|
||||
|
@ -1237,7 +1238,6 @@ struct string_list *dir_list_new_special(const char *input_dir,
|
|||
char ext_name[255];
|
||||
const char *exts = NULL;
|
||||
bool recursive = false;
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
|
@ -1318,7 +1318,7 @@ struct string_list *dir_list_new_special(const char *input_dir,
|
|||
}
|
||||
|
||||
return dir_list_new(input_dir, exts, false,
|
||||
settings->bools.show_hidden_files,
|
||||
show_hidden_files,
|
||||
type == DIR_LIST_CORE_INFO, recursive);
|
||||
}
|
||||
|
||||
|
@ -2273,8 +2273,9 @@ static bool dir_init_shader(const char *path_dir_shader)
|
|||
{
|
||||
unsigned i;
|
||||
struct rarch_dir_list *dir_list = (struct rarch_dir_list*)&dir_shader_list;
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
dir_list->list = dir_list_new_special(path_dir_shader, DIR_LIST_SHADERS, NULL);
|
||||
dir_list->list = dir_list_new_special(path_dir_shader, DIR_LIST_SHADERS, NULL, settings->bools.show_hidden_files);
|
||||
|
||||
if (!dir_list->list || dir_list->list->size == 0)
|
||||
{
|
||||
|
@ -5673,7 +5674,8 @@ static void command_event_set_savestate_auto_index(void)
|
|||
fill_pathname_basedir(state_dir, global->name.savestate,
|
||||
state_size);
|
||||
|
||||
dir_list = dir_list_new_special(state_dir, DIR_LIST_PLAIN, NULL);
|
||||
dir_list = dir_list_new_special(state_dir, DIR_LIST_PLAIN, NULL,
|
||||
settings->bools.show_hidden_files);
|
||||
|
||||
free(state_dir);
|
||||
|
||||
|
|
|
@ -266,7 +266,8 @@ static bool input_autoconfigure_joypad_from_conf_dir(
|
|||
fill_pathname_application_special(path, sizeof(path),
|
||||
APPLICATION_SPECIAL_DIRECTORY_AUTOCONFIG);
|
||||
|
||||
list = dir_list_new_special(path, DIR_LIST_AUTOCONFIG, "cfg");
|
||||
list = dir_list_new_special(path, DIR_LIST_AUTOCONFIG, "cfg",
|
||||
params->show_hidden_files);
|
||||
|
||||
if (!list || !list->size)
|
||||
{
|
||||
|
@ -277,7 +278,7 @@ static bool input_autoconfigure_joypad_from_conf_dir(
|
|||
}
|
||||
if (!string_is_empty(params->autoconfig_directory))
|
||||
list = dir_list_new_special(params->autoconfig_directory,
|
||||
DIR_LIST_AUTOCONFIG, "cfg");
|
||||
DIR_LIST_AUTOCONFIG, "cfg", params->show_hidden_files);
|
||||
}
|
||||
|
||||
if (!list)
|
||||
|
@ -518,6 +519,7 @@ void input_autoconfigure_connect(
|
|||
if (!string_is_empty(dir_autoconf))
|
||||
state->autoconfig_directory = strdup(dir_autoconf);
|
||||
|
||||
state->show_hidden_files = settings->bools.show_hidden_files;
|
||||
state->idx = idx;
|
||||
state->vid = vid;
|
||||
state->pid = pid;
|
||||
|
|
|
@ -56,6 +56,7 @@ struct autoconfig_params
|
|||
uint32_t max_users;
|
||||
char *name;
|
||||
char *autoconfig_directory;
|
||||
bool show_hidden_files;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue