From 348addd7d2dff6bb2d898a1db014332311fa0dcc Mon Sep 17 00:00:00 2001 From: Jens Verwiebe Date: Sat, 2 Nov 2013 17:58:53 +0000 Subject: OSX: give application bundles an own icon to better differentiate vs. folders --- source/blender/editors/space_file/file_draw.c | 3 +++ source/blender/editors/space_file/filelist.c | 7 +++++-- source/blender/makesdna/DNA_space_types.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 43df3be45ac..c4e6ca97418 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -251,6 +251,9 @@ static int get_file_icon(struct direntry *file) if (strcmp(file->relname, "..") == 0) { return ICON_FILE_PARENT; } + if (file->flags & APPLICATIONBUNDLE) { + return ICON_UGLYPACKAGE; + } if (file->flags & BLENDERFILE) { return ICON_FILE_BLEND; } diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 822d1ba8bca..6ee1afea5e9 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -772,6 +772,9 @@ static int path_extension_type(const char *path) else if (file_is_blend_backup(path)) { return BLENDERFILE_BACKUP; } + else if (BLI_testextensie(path, ".app")) { + return APPLICATIONBUNDLE; + } else if (BLI_testextensie(path, ".py")) { return PYSCRIPTFILE; } @@ -863,8 +866,8 @@ static void filelist_setfiletypes(struct FileList *filelist) for (num = 0; num < filelist->numfiles; num++, file++) { file->type = file->s.st_mode; /* restore the mess below */ - /* Don't check extensions for directories */ - if (file->type & S_IFDIR) { + /* Don't check extensions for directories, allow in OSX application bundles */ + if ((file->type & S_IFDIR) && (!APPLICATIONBUNDLE)) { continue; } file->flags = file_extension_type(filelist->dir, file->relname); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index faa99aaaad8..4ebfe349a9f 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -693,6 +693,7 @@ typedef enum eFileSel_File_Types { BTXFILE = (1 << 12), COLLADAFILE = (1 << 13), OPERATORFILE = (1 << 14), /* from filter_glob operator property */ + APPLICATIONBUNDLE = (1 << 15), } eFileSel_File_Types; /* Selection Flags in filesel: struct direntry, unsigned char selflag */ -- cgit v1.2.3