diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-05 14:23:41 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-05 14:23:41 +0300 |
commit | 89b654dc56b38a332e5bc4f82109152e21f0a5b6 (patch) | |
tree | 0c52cf9c418917fb2408207388d8b555a1210283 /source/blender/editors | |
parent | caf5a325b014e77e8a19fb8e40a3780964b609b6 (diff) |
FileBrowser: small tweak to new search feature: clear that string when changing dir.
In 99% of cases, you do not want to keep the same filter when changing dir,
and having to reset it by hand is *very* annoying!
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index bba5981b3b8..3e663275dcd 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -603,9 +603,12 @@ void file_change_dir(bContext *C, int checkdir) SpaceFile *sfile = CTX_wm_space_file(C); if (sfile->params) { - ED_fileselect_clear(wm, sfile); + /* Clear search string, it is very rare to want to keep that filter while changing dir, + * and usually very annoying to keep it actually! */ + sfile->params->filter_search[0] = '\0'; + if (checkdir && !BLI_is_dir(sfile->params->dir)) { BLI_strncpy(sfile->params->dir, filelist_dir(sfile->files), sizeof(sfile->params->dir)); /* could return but just refresh the current dir */ diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index bb55b643be8..f0555933146 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -199,7 +199,7 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa)) if (!sfile->files) { sfile->files = filelist_new(params->type); filelist_setdir(sfile->files, params->dir); - params->active_file = -1; // added this so it opens nicer (ton) + params->active_file = -1; /* added this so it opens nicer (ton) */ } filelist_setsorting(sfile->files, params->sort); filelist_setfilter_options(sfile->files, params->flag & FILE_HIDE_DOT, |