[Bf-blender-cvs] [370ed6025f4] master: File Browser/macOS: Don't treat .app as directory

Ankit Meel noreply at git.blender.org
Mon Oct 12 15:16:08 CEST 2020


Commit: 370ed6025f45fae4125c0f9f59707235f027fe91
Author: Ankit Meel
Date:   Fri Oct 9 16:49:03 2020 +0530
Branches: master
https://developer.blender.org/rB370ed6025f45fae4125c0f9f59707235f027fe91

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

===================================================================

M	source/blender/editors/space_file/filelist.c

===================================================================

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;
       }



More information about the Bf-blender-cvs mailing list