Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-04-24 02:08:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-04-24 02:08:11 +0400
commit62c0ac2dc9462b1e6e6b8b271cbcd100886a83e9 (patch)
treeb59162fcad8b5d7a98ea68263887fd0eb749d52b /source/blender/editors/space_outliner
parent28e8c04795e40af2a0b2fbc2885e6ab97d4daace (diff)
unix style outliner name wildcards *.*, Any.???, etc (using fnmatch), also removed last beos reference :)
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner.c24
1 files changed, 24 insertions, 0 deletions
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)