diff options
author | Leon Zandman <lzandman> | 2021-06-24 20:03:51 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-06-24 20:05:49 +0300 |
commit | beb6399ae5971fdbbf8aa6eb8832200afabeb97d (patch) | |
tree | 16a3be492eabe006f4d3347d6f9e741dced9de79 /source/blender/editors/space_file | |
parent | 15868b1ff4ad07ca5f7274b6c54f2f43a4ded955 (diff) |
Fix T89129: file dialog displays in-progress Safari downloads as a folder
In-progress Safari download files/packages are now recognized as bundles
and therefore not treated as directories.
Differential Revision: https://developer.blender.org/D11613
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 148799067bc..40a7be0423e 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1191,7 +1191,7 @@ static int filelist_geticon_ex(const FileDirEntry *file, if (FILENAME_IS_PARENT(file->relpath)) { return is_main ? ICON_FILE_PARENT : ICON_NONE; } - if (typeflag & FILE_TYPE_APPLICATIONBUNDLE) { + if (typeflag & FILE_TYPE_BUNDLE) { return ICON_UGLYPACKAGE; } if (typeflag & FILE_TYPE_BLENDER) { @@ -2519,9 +2519,16 @@ int ED_path_extension_type(const char *path) if (file_is_blend_backup(path)) { return FILE_TYPE_BLENDER_BACKUP; } - if (BLI_path_extension_check(path, ".app")) { - return FILE_TYPE_APPLICATIONBUNDLE; +#ifdef __APPLE__ + if (BLI_path_extension_check_n(path, + /* Application bundle */ + ".app", + /* Safari in-progress/paused download */ + ".download", + NULL)) { + return FILE_TYPE_BUNDLE; } +#endif if (BLI_path_extension_check(path, ".py")) { return FILE_TYPE_PYSCRIPT; } @@ -2815,7 +2822,7 @@ static int filelist_readjob_list_dir(const char *root, entry->attributes = BLI_file_attributes(full_path); if (S_ISDIR(files[i].s.st_mode) #ifdef __APPLE__ - && !(ED_path_extension_type(full_path) & FILE_TYPE_APPLICATIONBUNDLE) + && !(ED_path_extension_type(full_path) & FILE_TYPE_BUNDLE) #endif ) { entry->typeflag = FILE_TYPE_DIR; |