reset filebrowser to avoid stray entries being left in when we

go from one filebrowser entry to the next
This commit is contained in:
twinaphex 2016-07-14 22:36:18 +02:00
parent 194eaf3053
commit 4df71207ff
2 changed files with 32 additions and 0 deletions

View File

@ -249,6 +249,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_AUDIO_DSP_PLUGIN:
menu_displaylist_reset_filebrowser();
info.directory_ptr = idx;
info_path = settings->directory.audio_filter;
info_label = msg_hash_to_str(MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN);
@ -256,6 +257,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
break;
case ACTION_OK_DL_SHADER_PASS:
menu_displaylist_reset_filebrowser();
info.type = type;
info.directory_ptr = idx;
info_path = settings->directory.video_shader;
@ -279,6 +281,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_FILE_BROWSER_SELECT_DIR:
menu_displaylist_reset_filebrowser();
if (path)
strlcpy(menu->deferred_path, path,
sizeof(menu->deferred_path));
@ -296,6 +299,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_SHADER_PRESET:
menu_displaylist_reset_filebrowser();
info.type = type;
info.directory_ptr = idx;
info_path = settings->directory.video_shader;
@ -303,6 +307,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
break;
case ACTION_OK_DL_CONTENT_LIST:
menu_displaylist_reset_filebrowser();
info.type = FILE_TYPE_DIRECTORY;
info.directory_ptr = idx;
info_path = new_path;
@ -317,6 +322,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_FILE_BROWSER_SCAN_DIR;
break;
case ACTION_OK_DL_REMAP_FILE:
menu_displaylist_reset_filebrowser();
info.type = type;
info.directory_ptr = idx;
info_path = settings->directory.input_remapping;
@ -326,6 +332,7 @@ int generic_action_ok_displaylist_push(const char *path,
case ACTION_OK_DL_RECORD_CONFIGFILE:
{
global_t *global = global_get_ptr();
menu_displaylist_reset_filebrowser();
info.type = type;
info.directory_ptr = idx;
info_path = global->record.config_dir;
@ -334,6 +341,7 @@ int generic_action_ok_displaylist_push(const char *path,
}
break;
case ACTION_OK_DL_DISK_IMAGE_APPEND_LIST:
menu_displaylist_reset_filebrowser();
info.type = type;
info.directory_ptr = idx;
info_path = settings->directory.menu_content;
@ -341,6 +349,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
break;
case ACTION_OK_DL_PLAYLIST_COLLECTION:
menu_displaylist_reset_filebrowser();
info.type = type;
info.directory_ptr = idx;
info_path = path;
@ -348,6 +357,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_CHEAT_FILE:
menu_displaylist_reset_filebrowser();
info.type = type;
info.directory_ptr = idx;
info_path = settings->path.cheat_database;
@ -355,6 +365,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
break;
case ACTION_OK_DL_CORE_LIST:
menu_displaylist_reset_filebrowser();
info.type = type;
info.directory_ptr = idx;
info_path = settings->directory.libretro;
@ -362,6 +373,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_CORE;
break;
case ACTION_OK_DL_CONTENT_COLLECTION_LIST:
menu_displaylist_reset_filebrowser();
info.type = type;
info.directory_ptr = idx;
info_path = settings->directory.playlist;
@ -369,6 +381,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_COLLECTION;
break;
case ACTION_OK_DL_RDB_ENTRY:
menu_displaylist_reset_filebrowser();
fill_pathname_join_delim(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL),
path, '|', sizeof(tmp));
@ -442,6 +455,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_DATABASE_MANAGER_LIST:
menu_displaylist_reset_filebrowser();
fill_pathname_join(tmp,
settings->path.content_database,
path, sizeof(tmp));
@ -454,6 +468,7 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_CURSOR_MANAGER_LIST:
menu_displaylist_reset_filebrowser();
fill_pathname_join(tmp, settings->directory.cursor,
path, sizeof(tmp));

View File

@ -3494,6 +3494,7 @@ static int menu_displaylist_parse_generic(
menu_entries_set_alt_at_offset(info->list, i, display_name);
}
info->need_sort = true;
return 0;
}
/* We don't want to show 'filter by extension' for this. */
@ -3635,6 +3636,7 @@ static bool menu_displaylist_push_internal(
{
settings_t *settings = config_get_ptr();
menu_displaylist_reset_filebrowser();
info->type = 42;
strlcpy(info->exts, "lpl", sizeof(info->exts));
strlcpy(info->label,
@ -5359,6 +5361,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
info->need_push = true;
break;
case DISPLAYLIST_DATABASES:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_RDB;
strlcpy(info->exts,
file_path_str(FILE_PATH_RDB_EXTENSION),
@ -5397,6 +5400,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
info->need_push = true;
break;
case DISPLAYLIST_DATABASE_CURSORS:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_CURSOR;
strlcpy(info->exts, "dbc", sizeof(info->exts));
strlcpy(info->path, settings->directory.cursor, sizeof(info->path));
@ -5405,56 +5409,69 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
{
char ext_name[PATH_MAX_LENGTH] = {0};
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_PLAIN;
if (frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
strlcpy(info->exts, ext_name, sizeof(info->exts));
}
break;
case DISPLAYLIST_CONFIG_FILES:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_CONFIG;
strlcpy(info->exts, "cfg", sizeof(info->exts));
break;
case DISPLAYLIST_SHADER_PRESET:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_SHADER_PRESET;
strlcpy(info->exts, "cgp|glslp|slangp", sizeof(info->exts));
break;
case DISPLAYLIST_SHADER_PASS:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_SHADER;
strlcpy(info->exts, "cg|glsl|slang", sizeof(info->exts));
break;
case DISPLAYLIST_VIDEO_FILTERS:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_VIDEOFILTER;
strlcpy(info->exts, "filt", sizeof(info->exts));
break;
case DISPLAYLIST_IMAGES:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_IMAGE;
strlcpy(info->exts, "png|jpg|jpeg|bmp|tga", sizeof(info->exts));
break;
case DISPLAYLIST_AUDIO_FILTERS:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_AUDIOFILTER;
strlcpy(info->exts, "dsp", sizeof(info->exts));
break;
case DISPLAYLIST_CHEAT_FILES:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_CHEAT;
strlcpy(info->exts, "cht", sizeof(info->exts));
break;
case DISPLAYLIST_CONTENT_HISTORY:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_PLAIN;
strlcpy(info->exts, "lpl", sizeof(info->exts));
break;
case DISPLAYLIST_FONTS:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_FONT;
strlcpy(info->exts, "ttf", sizeof(info->exts));
break;
case DISPLAYLIST_OVERLAYS:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_OVERLAY;
strlcpy(info->exts, "cfg", sizeof(info->exts));
break;
case DISPLAYLIST_RECORD_CONFIG_FILES:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_RECORD_CONFIG;
strlcpy(info->exts, "cfg", sizeof(info->exts));
break;
case DISPLAYLIST_REMAP_FILES:
menu_displaylist_reset_filebrowser();
info->type_default = FILE_TYPE_REMAP;
strlcpy(info->exts, "rmp", sizeof(info->exts));
break;