From 370ed6025f45fae4125c0f9f59707235f027fe91 Mon Sep 17 00:00:00 2001 From: Ankit Meel Date: Fri, 9 Oct 2020 16:49:03 +0530 Subject: File Browser/macOS: Don't treat .app as directory While there are other bundles which show up as directories, `.app` are the most common ones. *Users should not be saving anything inside .app bundles, nor using Blender to edit any of the files. *This declutters the File Browser for say ~/Applications folder or recursive search on a path with apps. *Matches Finder's behavior of showing apps as files. (We don't have a "right click > show package contents" button like Finder though) This change shows `.app` files like incompatible files, or `.exe`s on Windows. {F8970986} Reviewed By: #platform_macos, brecht, mont29 Differential Revision: https://developer.blender.org/D9162 --- source/blender/editors/space_file/filelist.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 84352127264..3004aadb5dd 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -2504,7 +2504,11 @@ static int filelist_readjob_list_dir(const char *root, /* Set initial file type and attributes. */ entry->attributes = BLI_file_attributes(full_path); - if (S_ISDIR(files[i].s.st_mode)) { + if (S_ISDIR(files[i].s.st_mode) +#ifdef __APPLE__ + && !(ED_path_extension_type(full_path) & FILE_TYPE_APPLICATIONBUNDLE) +#endif + ) { entry->typeflag = FILE_TYPE_DIR; } -- cgit v1.2.3