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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user