Page MenuHome
Paste P2455

Possible fix for broken File Browser recursion
ActivePublic

Authored by Julian Eisel (Severin) on Sep 29 2021, 6:50 PM.
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 60fe5364aba..181369ed657 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -3219,6 +3219,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)
{
@@ -3226,10 +3227,14 @@ 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;
}
+ 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. */
@@ -3345,7 +3350,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);