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:
authorLeon Zandman <lzandman>2021-06-24 20:03:51 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-06-24 20:05:49 +0300
commitbeb6399ae5971fdbbf8aa6eb8832200afabeb97d (patch)
tree16a3be492eabe006f4d3347d6f9e741dced9de79
parent15868b1ff4ad07ca5f7274b6c54f2f43a4ded955 (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
-rw-r--r--source/blender/editors/space_file/filelist.c15
-rw-r--r--source/blender/makesdna/DNA_space_types.h2
2 files changed, 12 insertions, 5 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;
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 7804ece9769..2b9a4f7ba1d 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -1019,7 +1019,7 @@ typedef enum eFileSel_File_Types {
FILE_TYPE_COLLADA = (1 << 13),
/** from filter_glob operator property */
FILE_TYPE_OPERATOR = (1 << 14),
- FILE_TYPE_APPLICATIONBUNDLE = (1 << 15),
+ FILE_TYPE_BUNDLE = (1 << 15),
FILE_TYPE_ALEMBIC = (1 << 16),
/** For all kinds of recognized import/export formats. No need for specialized types. */
FILE_TYPE_OBJECT_IO = (1 << 17),