diff options
author | Pablo Vazquez <pablo@blender.org> | 2021-10-04 17:21:26 +0300 |
---|---|---|
committer | Pablo Vazquez <pablo@blender.org> | 2021-10-04 17:21:26 +0300 |
commit | f0731bd5ac78856e69f1ee09e4762e7d42dc17c9 (patch) | |
tree | af1576c25c72517e970fbe07a4a7ad2d1248004f /source/blender/editors/space_file/filelist.c | |
parent | 2c5661682b61ac4a8a8f45f77a4eff7b85f6f141 (diff) | |
parent | 4a3464050c4e83d446d47c946e17b9540f5a3862 (diff) |
Merge branch 'master' into temp-ui-tweakstemp-ui-tweaks
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index b58a04d6d4f..a927b62fd6e 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -3295,6 +3295,7 @@ typedef struct FileListReadJob { } FileListReadJob; static bool filelist_readjob_should_recurse_into_entry(const int max_recursion, + const bool is_lib, const int current_recursion_level, FileListInternEntry *entry) { @@ -3302,10 +3303,16 @@ static bool filelist_readjob_should_recurse_into_entry(const int max_recursion, /* Recursive loading is disabled. */ return false; } - if (current_recursion_level >= max_recursion) { + if (!is_lib && current_recursion_level > max_recursion) { /* No more levels of recursion left. */ return false; } + /* Show entries when recursion is set to `Blend file` even when `current_recursion_level` exceeds + * `max_recursion`. */ + if (!is_lib && (current_recursion_level >= max_recursion) && + ((entry->typeflag & (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP)) == 0)) { + return false; + } if (entry->typeflag & FILE_TYPE_BLENDERLIB) { /* Libraries are already loaded recursively when recursive loaded is used. No need to add * them another time. This loading is done with the `LIST_LIB_RECURSIVE` option. */ @@ -3421,7 +3428,8 @@ static void filelist_readjob_do(const bool do_lib, entry->name = fileentry_uiname(root, entry->relpath, entry->typeflag, dir); entry->free_name = true; - if (filelist_readjob_should_recurse_into_entry(max_recursion, recursion_level, entry)) { + if (filelist_readjob_should_recurse_into_entry( + max_recursion, is_lib, recursion_level, entry)) { /* We have a directory we want to list, add it to todo list! */ BLI_join_dirfile(dir, sizeof(dir), root, entry->relpath); BLI_path_normalize_dir(job_params->main_name, dir); |