[Bf-blender-cvs] [5eaa873] asset-experiments: Moar fixes (re ; ostly filtering mixed lib/data and regular files).
Bastien Montagne
noreply at git.blender.org
Sat Dec 6 18:18:59 CET 2014
Commit: 5eaa8739c5e0836dae0177106d8276199d4a5d0f
Author: Bastien Montagne
Date: Sat Dec 6 18:10:59 2014 +0100
Branches: asset-experiments
https://developer.blender.org/rB5eaa8739c5e0836dae0177106d8276199d4a5d0f
Moar fixes (re ;ostly filtering mixed lib/data and regular files).
===================================================================
M source/blender/editors/space_file/filelist.c
M source/blender/makesdna/DNA_space_types.h
===================================================================
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index dd68271..89a81d1 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1031,6 +1031,9 @@ static void filelist_setfiletypes(struct FileList *filelist)
file = filelist->filelist;
for (num = 0; num < filelist->numfiles; num++, file++) {
+ if (file->flags & BLENDERLIB) {
+ continue;
+ }
file->type = file->s.st_mode; /* restore the mess below */
#ifndef __APPLE__
/* Don't check extensions for directories, allow in OSX cause bundles have extensions*/
@@ -1438,17 +1441,20 @@ static void filelist_from_library(struct FileList *filelist, const bool add_pare
if (add_parent) {
filelist->filelist[nnames].relname = BLI_strdup("..");
filelist->filelist[nnames].type |= S_IFDIR;
+ filelist->filelist[nnames].flags |= BLENDERLIB;
}
for (i = 0, l = names; i < nnames; i++, l = l->next) {
const char *blockname = l->link;
+ struct direntry *file = &filelist->filelist[i];
- filelist->filelist[i].relname = BLI_strdup(blockname);
+ file->relname = BLI_strdup(blockname);
+ file->flags |= BLENDERLIB;
if (idcode) {
- filelist->filelist[i].type |= S_IFREG;
+ file->type |= S_IFREG;
}
else {
- filelist->filelist[i].type |= S_IFDIR;
+ file->type |= S_IFDIR;
}
}
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 1d5030b..565f67d 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -708,6 +708,8 @@ typedef enum eFileSel_File_Types {
COLLADAFILE = (1 << 13),
OPERATORFILE = (1 << 14), /* from filter_glob operator property */
APPLICATIONBUNDLE = (1 << 15),
+
+ BLENDERLIB = (1 << 31),
} eFileSel_File_Types;
/* Selection Flags in filesel: struct direntry, unsigned char selflag */
More information about the Bf-blender-cvs
mailing list