diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-24 11:05:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-24 11:05:43 +0400 |
commit | 6a4b9298c80d0f27637f88cca0ad9f05040608d3 (patch) | |
tree | b53d155d0339d16b743ae1ed483786ab79393788 /source/blender/editors/space_file/filesel.c | |
parent | 99643037caef3539fdac807b22431bd6cc5deba7 (diff) |
patch [#23968] filter_filetypes property to allow operators to filter by file extensions in the file selector
modified the patch to store the string internally rather then an array of allocated string pointers, less hassle with memory allocation.
changed to use fnmatch, so *.foo is needed (not .foo as with the patch)
Diffstat (limited to 'source/blender/editors/space_file/filesel.c')
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index e2099be6f03..ccdf0855104 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -105,6 +105,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) sfile->params= MEM_callocN(sizeof(FileSelectParams), "fileselparams"); /* set path to most recently opened .blend */ BLI_split_dirfile(G.sce, sfile->params->dir, sfile->params->file); + sfile->params->filter_glob[0] = '\0'; } params = sfile->params; @@ -168,6 +169,11 @@ short ED_fileselect_set_params(SpaceFile *sfile) params->filter |= RNA_boolean_get(op->ptr, "filter_btx") ? BTXFILE : 0; if(RNA_struct_find_property(op->ptr, "filter_collada")) params->filter |= RNA_boolean_get(op->ptr, "filter_collada") ? COLLADAFILE : 0; + if (RNA_struct_find_property(op->ptr, "filter_glob")) { + RNA_string_get(op->ptr, "filter_glob", params->filter_glob); + params->filter |= (OPERATORFILE|FOLDERFILE); + } + if (params->filter != 0) { if (U.uiflag & USER_FILTERFILEEXTS) { params->flag |= FILE_FILTER; |