OSX: give application bundles an own icon to better differentiate vs. folders

This commit is contained in:
Jens Verwiebe 2013-11-02 17:58:53 +00:00
parent a8a4431fcf
commit 348addd7d2
3 changed files with 9 additions and 2 deletions

@ -251,6 +251,9 @@ static int get_file_icon(struct direntry *file)
if (strcmp(file->relname, "..") == 0) { if (strcmp(file->relname, "..") == 0) {
return ICON_FILE_PARENT; return ICON_FILE_PARENT;
} }
if (file->flags & APPLICATIONBUNDLE) {
return ICON_UGLYPACKAGE;
}
if (file->flags & BLENDERFILE) { if (file->flags & BLENDERFILE) {
return ICON_FILE_BLEND; return ICON_FILE_BLEND;
} }

@ -772,6 +772,9 @@ static int path_extension_type(const char *path)
else if (file_is_blend_backup(path)) { else if (file_is_blend_backup(path)) {
return BLENDERFILE_BACKUP; return BLENDERFILE_BACKUP;
} }
else if (BLI_testextensie(path, ".app")) {
return APPLICATIONBUNDLE;
}
else if (BLI_testextensie(path, ".py")) { else if (BLI_testextensie(path, ".py")) {
return PYSCRIPTFILE; return PYSCRIPTFILE;
} }
@ -863,8 +866,8 @@ static void filelist_setfiletypes(struct FileList *filelist)
for (num = 0; num < filelist->numfiles; num++, file++) { for (num = 0; num < filelist->numfiles; num++, file++) {
file->type = file->s.st_mode; /* restore the mess below */ file->type = file->s.st_mode; /* restore the mess below */
/* Don't check extensions for directories */ /* Don't check extensions for directories, allow in OSX application bundles */
if (file->type & S_IFDIR) { if ((file->type & S_IFDIR) && (!APPLICATIONBUNDLE)) {
continue; continue;
} }
file->flags = file_extension_type(filelist->dir, file->relname); file->flags = file_extension_type(filelist->dir, file->relname);

@ -693,6 +693,7 @@ typedef enum eFileSel_File_Types {
BTXFILE = (1 << 12), BTXFILE = (1 << 12),
COLLADAFILE = (1 << 13), COLLADAFILE = (1 << 13),
OPERATORFILE = (1 << 14), /* from filter_glob operator property */ OPERATORFILE = (1 << 14), /* from filter_glob operator property */
APPLICATIONBUNDLE = (1 << 15),
} eFileSel_File_Types; } eFileSel_File_Types;
/* Selection Flags in filesel: struct direntry, unsigned char selflag */ /* Selection Flags in filesel: struct direntry, unsigned char selflag */