diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-04-24 02:08:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-04-24 02:08:11 +0400 |
commit | 62c0ac2dc9462b1e6e6b8b271cbcd100886a83e9 (patch) | |
tree | b59162fcad8b5d7a98ea68263887fd0eb749d52b /source/blender/editors | |
parent | 28e8c04795e40af2a0b2fbc2885e6ab97d4daace (diff) |
unix style outliner name wildcards *.*, Any.???, etc (using fnmatch), also removed last beos reference :)
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 12 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 24 |
2 files changed, 27 insertions, 9 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 64ca0a8e572..ea098ffcdb4 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -77,16 +77,10 @@ #include "file_intern.h" #include "filelist.h" -#if defined __BeOS -static int fnmatch(const char *pattern, const char *string, int flags) -{ - return 0; -} -#elif defined WIN32 && !defined _LIBC - /* use fnmatch included in blenlib */ - #include "BLI_fnmatch.h" +#if defined WIN32 && !defined _LIBC +# include "BLI_fnmatch.h" /* use fnmatch included in blenlib */ #else - #include <fnmatch.h> +# include <fnmatch.h> #endif FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile) diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 49cd196231e..1ec203ac740 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -50,6 +50,13 @@ #include "BLI_blenlib.h" +#if defined WIN32 && !defined _LIBC +# include "BLI_fnmatch.h" /* use fnmatch included in blenlib */ +#else +# define _GNU_SOURCE +# include <fnmatch.h> +#endif + #include "IMB_imbuf_types.h" #include "BKE_animsys.h" @@ -1237,6 +1244,7 @@ void add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *te, short index) static int outliner_filter_has_name(TreeElement *te, char *name, int flags) { +#if 0 int found= 0; /* determine if match */ @@ -1252,8 +1260,24 @@ static int outliner_filter_has_name(TreeElement *te, char *name, int flags) else found= BLI_strcasestr(te->name, name) != NULL; } +#else + + int fn_flag= 0; + int found= 0; + if(flags & SO_FIND_CASE_SENSITIVE) + fn_flag |= FNM_CASEFOLD; + + if(flags & SO_FIND_COMPLETE) { + found= fnmatch(name, te->name, fn_flag)==0; + } + else { + char fn_name[sizeof(((struct SpaceOops *)NULL)->search_string) + 2]; + sprintf(fn_name, "*%s*", name); + found= fnmatch(fn_name, te->name, fn_flag)==0; + } return found; +#endif } static int outliner_filter_tree(SpaceOops *soops, ListBase *lb) |