Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Meel <ankitjmeel@gmail.com>2020-10-09 14:19:03 +0300
committerAnkit Meel <ankitjmeel@gmail.com>2020-10-12 16:15:39 +0300
commit370ed6025f45fae4125c0f9f59707235f027fe91 (patch)
tree941053775b2ff703aefbac8174fdd4beb562431b
parentc4c8d855c67d596498a99b5992d70b83fa9314e9 (diff)
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
-rw-r--r--source/blender/editors/space_file/filelist.c6
1 files changed, 5 insertions, 1 deletions
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;
}