Remove menu_type_is - now obsolete

This commit is contained in:
twinaphex 2015-01-10 05:25:37 +01:00
parent 16697eb632
commit ef720d3815
7 changed files with 29 additions and 49 deletions

View File

@ -498,30 +498,3 @@ int menu_iterate(retro_input_t input,
return 0; return 0;
} }
unsigned menu_type_is(const char *label, unsigned type)
{
if (
!strcmp(label, "rgui_browser_directory") ||
!strcmp(label, "content_directory") ||
!strcmp(label, "assets_directory") ||
!strcmp(label, "content_database_path") ||
!strcmp(label, "cheat_database_path") ||
!strcmp(label, "video_shader_dir") ||
!strcmp(label, "video_filter_dir") ||
!strcmp(label, "audio_filter_dir") ||
!strcmp(label, "savestate_directory") ||
!strcmp(label, "libretro_dir_path") ||
!strcmp(label, "libretro_info_path") ||
!strcmp(label, "rgui_config_directory") ||
!strcmp(label, "savefile_directory") ||
!strcmp(label, "overlay_directory") ||
!strcmp(label, "screenshot_directory") ||
!strcmp(label, "joypad_autoconfig_dir") ||
!strcmp(label, "playlist_directory") ||
!strcmp(label, "extraction_directory") ||
!strcmp(label, "system_directory"))
return MENU_FILE_DIRECTORY;
return 0;
}

View File

@ -213,11 +213,8 @@ void menu_update_system_info(menu_handle_t *menu, bool *load_no_content);
**/ **/
void menu_update_libretro_info(struct retro_system_info *info); void menu_update_libretro_info(struct retro_system_info *info);
unsigned menu_type_is(const char *label, unsigned type);
void apply_deferred_settings(void); void apply_deferred_settings(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -324,7 +324,8 @@ static void parse_drive_list(file_list_t *list)
int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list, int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list,
const char *dir, const char *label, unsigned type, const char *dir, const char *label, unsigned type,
unsigned default_type_plain, const char *exts) unsigned default_type_plain, const char *exts,
rarch_setting_t *setting)
{ {
size_t i, list_size; size_t i, list_size;
bool path_is_compressed, push_dir; bool path_is_compressed, push_dir;
@ -351,7 +352,7 @@ int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list,
#endif #endif
path_is_compressed = path_is_compressed_file(dir); path_is_compressed = path_is_compressed_file(dir);
push_dir = menu_type_is(label, type) == MENU_FILE_DIRECTORY; push_dir = (setting && setting->browser_selection_type == ST_DIR);
if (path_is_compressed) if (path_is_compressed)
str_list = compressed_file_list_new(dir,exts); str_list = compressed_file_list_new(dir,exts);

View File

@ -28,7 +28,8 @@ extern "C" {
int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list, int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list,
const char *dir, const char *label, unsigned type, const char *dir, const char *label, unsigned type,
unsigned default_type_plain, const char *exts); unsigned default_type_plain, const char *exts,
rarch_setting_t *setting);
int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list); int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list);

View File

@ -2147,7 +2147,7 @@ static int deferred_push_core_list(void *data, void *userdata,
return -1; return -1;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_PLAIN, EXT_EXECUTABLES); type, MENU_FILE_PLAIN, EXT_EXECUTABLES, NULL);
return 0; return 0;
} }
@ -2265,7 +2265,7 @@ static int deferred_push_configurations(void *data, void *userdata,
return -1; return -1;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_CONFIG, "cfg"); type, MENU_FILE_CONFIG, "cfg", NULL);
return 0; return 0;
} }
@ -2280,7 +2280,7 @@ static int deferred_push_video_shader_preset(void *data, void *userdata,
return -1; return -1;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_SHADER_PRESET, "cgp|glslp"); type, MENU_FILE_SHADER_PRESET, "cgp|glslp", NULL);
return 0; return 0;
} }
@ -2295,7 +2295,7 @@ static int deferred_push_video_shader_pass(void *data, void *userdata,
return -1; return -1;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_SHADER, "cg|glsl"); type, MENU_FILE_SHADER, "cg|glsl", NULL);
return 0; return 0;
} }
@ -2310,7 +2310,7 @@ static int deferred_push_video_filter(void *data, void *userdata,
return -1; return -1;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_VIDEOFILTER, "filt"); type, MENU_FILE_VIDEOFILTER, "filt", NULL);
return 0; return 0;
} }
@ -2325,7 +2325,7 @@ static int deferred_push_audio_dsp_plugin(void *data, void *userdata,
return -1; return -1;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_AUDIOFILTER, "dsp"); type, MENU_FILE_AUDIOFILTER, "dsp", NULL);
return 0; return 0;
} }
@ -2340,7 +2340,7 @@ static int deferred_push_cheat_file_load(void *data, void *userdata,
return -1; return -1;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_CHEAT, "cht"); type, MENU_FILE_CHEAT, "cht", NULL);
return 0; return 0;
} }
@ -2355,7 +2355,7 @@ static int deferred_push_input_overlay(void *data, void *userdata,
return -1; return -1;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_OVERLAY, "cfg"); type, MENU_FILE_OVERLAY, "cfg", NULL);
return 0; return 0;
} }
@ -2370,7 +2370,7 @@ static int deferred_push_video_font_path(void *data, void *userdata,
return -1; return -1;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_FONT, "ttf"); type, MENU_FILE_FONT, "ttf", NULL);
return 0; return 0;
} }
@ -2385,7 +2385,7 @@ static int deferred_push_content_history_path(void *data, void *userdata,
return -1; return -1;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_PLAIN, "cfg"); type, MENU_FILE_PLAIN, "cfg", NULL);
return 0; return 0;
} }
@ -2404,7 +2404,7 @@ static int deferred_push_detect_core_list(void *data, void *userdata,
g_extern.core_info) : ""; g_extern.core_info) : "";
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_PLAIN, exts); type, MENU_FILE_PLAIN, exts, NULL);
return 0; return 0;
} }
@ -2416,11 +2416,13 @@ static int deferred_push_default(void *data, void *userdata,
const char *exts = NULL; const char *exts = NULL;
file_list_t *list = (file_list_t*)data; file_list_t *list = (file_list_t*)data;
file_list_t *menu_list = (file_list_t*)userdata; file_list_t *menu_list = (file_list_t*)userdata;
rarch_setting_t *setting = (rarch_setting_t*)
setting_data_find_setting(driver.menu->list_settings, label);
if (!list || !menu_list) if (!list || !menu_list)
return -1; return -1;
if (menu_type_is(label, type) == MENU_FILE_DIRECTORY) if (setting && setting->browser_selection_type == ST_DIR)
exts = ""; /* we ignore files anyway */ exts = ""; /* we ignore files anyway */
else if (g_extern.menu.info.valid_extensions) else if (g_extern.menu.info.valid_extensions)
{ {
@ -2435,7 +2437,7 @@ static int deferred_push_default(void *data, void *userdata,
exts = g_extern.system.valid_extensions; exts = g_extern.system.valid_extensions;
menu_entries_parse_list(list, menu_list, path, label, menu_entries_parse_list(list, menu_list, path, label,
type, MENU_FILE_PLAIN, exts); type, MENU_FILE_PLAIN, exts, setting);
return 0; return 0;
} }
@ -2616,6 +2618,9 @@ static void menu_entries_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs,
static void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs, static void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx) const char *path, const char *label, unsigned type, size_t idx)
{ {
rarch_setting_t *setting = (rarch_setting_t*)
setting_data_find_setting(driver.menu->list_settings, label);
if (!cbs) if (!cbs)
return; return;
@ -2660,7 +2665,7 @@ static void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
cbs->action_ok = action_ok_push_content_list; cbs->action_ok = action_ok_push_content_list;
else if (!strcmp(label, "history_list")) else if (!strcmp(label, "history_list"))
cbs->action_ok = action_ok_push_history_list; cbs->action_ok = action_ok_push_history_list;
else if (menu_type_is(label, type) == MENU_FILE_DIRECTORY) else if (setting && setting->browser_selection_type == ST_DIR)
cbs->action_ok = action_ok_push_path_list; cbs->action_ok = action_ok_push_path_list;
else if (!strcmp(label, "shader_apply_changes")) else if (!strcmp(label, "shader_apply_changes"))
cbs->action_ok = action_ok_shader_apply_changes; cbs->action_ok = action_ok_shader_apply_changes;

View File

@ -1732,9 +1732,11 @@ rarch_setting_t setting_data_string_setting(enum setting_type type,
{ {
case ST_DIR: case ST_DIR:
result.action_start = setting_data_string_dir_action_start_default; result.action_start = setting_data_string_dir_action_start_default;
result.browser_selection_type = ST_DIR;
break; break;
case ST_PATH: case ST_PATH:
result.action_start = setting_data_string_dir_action_start_default; result.action_start = setting_data_string_dir_action_start_default;
result.browser_selection_type = ST_PATH;
break; break;
default: default:
break; break;

View File

@ -175,6 +175,7 @@ typedef struct rarch_setting
} boolean; } boolean;
unsigned bind_type; unsigned bind_type;
unsigned browser_selection_type;
float step; float step;
const char *rounding_fraction; const char *rounding_fraction;
bool enforce_minrange; bool enforce_minrange;