More refactors pt. 2

This commit is contained in:
twinaphex 2015-05-12 12:37:42 +02:00
parent e2d7139c71
commit 35a55f97ae
3 changed files with 17 additions and 20 deletions

View File

@ -74,6 +74,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
ret = menu_entries_push_list(menu, info->list,
info->path, info->label, info->type, info->flags);
break;
case DISPLAYLIST_DEFAULT:
case DISPLAYLIST_CORES:
case DISPLAYLIST_CORES_DETECTED:
case DISPLAYLIST_SHADER_PASS:
@ -92,7 +93,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
case DISPLAYLIST_CONTENT_HISTORY:
ret = menu_entries_parse_list(info->list, info->menu_list,
info->path, info->label, info->type,
info->type_default, info->exts, NULL);
info->type_default, info->exts, info->setting);
break;
case DISPLAYLIST_PERFCOUNTER_SELECTION:
menu_list_clear(info->list);

View File

@ -19,6 +19,7 @@
#include <stdint.h>
#include <retro_miscellaneous.h>
#include "menu_list.h"
#include "menu_setting.h"
#ifdef __cplusplus
extern "C" {
@ -29,6 +30,7 @@ enum
DISPLAYLIST_NONE = 0,
DISPLAYLIST_MAIN_MENU,
DISPLAYLIST_SETTINGS,
DISPLAYLIST_DEFAULT,
DISPLAYLIST_CORES,
DISPLAYLIST_CORES_DETECTED,
DISPLAYLIST_PERFCOUNTER_SELECTION,
@ -60,6 +62,7 @@ typedef struct menu_displaylist_info
unsigned type;
unsigned type_default;
unsigned flags;
rarch_setting_t *setting;
} menu_displaylist_info_t;
int menu_displaylist_deferred_push(menu_displaylist_info_t *info);

View File

@ -2197,35 +2197,28 @@ static int deferred_push_detect_core_list(void *data, void *userdata,
static int deferred_push_default(void *data, void *userdata,
const char *path, const char *label, unsigned type)
{
char ext_buf[PATH_MAX_LENGTH];
const char *exts = NULL;
file_list_t *list = (file_list_t*)data;
file_list_t *menu_list = (file_list_t*)userdata;
rarch_setting_t *setting = (rarch_setting_t*)
menu_setting_find(label);
menu_displaylist_info_t info = {0};
global_t *global = global_get_ptr();
if (!list || !menu_list)
return -1;
info.list = (file_list_t*)data;
info.menu_list = (file_list_t*)userdata;
info.type = type;
info.type_default = MENU_FILE_PLAIN;
strlcpy(info.path, path, sizeof(info.path));
strlcpy(info.label, label, sizeof(info.label));
info.setting = menu_setting_find(label);
if (setting && setting->browser_selection_type == ST_DIR)
exts = ""; /* we ignore files anyway */
if (info.setting && info.setting->browser_selection_type == ST_DIR) {}
else if (global->menu.info.valid_extensions)
{
exts = ext_buf;
if (*global->menu.info.valid_extensions)
snprintf(ext_buf, sizeof(ext_buf), "%s",
snprintf(info.exts, sizeof(info.exts), "%s",
global->menu.info.valid_extensions);
else
*ext_buf = '\0';
}
else
exts = global->system.valid_extensions;
strlcpy(info.exts, global->system.valid_extensions, sizeof(info.exts));
menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_PLAIN, exts, setting);
return 0;
return menu_displaylist_push_list(&info, DISPLAYLIST_DEFAULT);
}
void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,