OSX: give application bundles an own icon to better differentiate vs. folders
authorJens Verwiebe <info@jensverwiebe.de>
Sat, 2 Nov 2013 17:58:53 +0000 (17:58 +0000)
committerJens Verwiebe <info@jensverwiebe.de>
Sat, 2 Nov 2013 17:58:53 +0000 (17:58 +0000)
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/filelist.c
source/blender/makesdna/DNA_space_types.h

index 43df3be45accb0f1c73849e29da833f1edee72c9..c4e6ca974181ab1329ce92ed82d3bba1f6d8b313 100644 (file)
@@ -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;
                }
index 822d1ba8bcae1fb938748bdaf9ab4b819816808b..6ee1afea5e9d935656fcc90eda42037a2bfcac5d 100644 (file)
@@ -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);
index faa99aaaad89fd6658531c58be2467b504d9cf94..4ebfe349a9f0c40cf710db90050797dc070d1278 100644 (file)
@@ -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 */