diff options
author | Campbell Barton <campbell@blender.org> | 2022-11-03 06:35:32 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-11-03 06:38:15 +0300 |
commit | 50c72069b475a917769db077f39355755b4c0774 (patch) | |
tree | c8d458421fcd0cb75c07f92e73ba7f93f5d5ce3f /source/blender/editors/space_file/filelist.cc | |
parent | 92b2f4d24999d463d20e7a134bff414f0a8a9d77 (diff) |
Cleanup: replace BLI_join_path with BLI_join_string
There is no need to use path joining logic here.
Diffstat (limited to 'source/blender/editors/space_file/filelist.cc')
-rw-r--r-- | source/blender/editors/space_file/filelist.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/space_file/filelist.cc b/source/blender/editors/space_file/filelist.cc index 3257534f94d..3870178f119 100644 --- a/source/blender/editors/space_file/filelist.cc +++ b/source/blender/editors/space_file/filelist.cc @@ -31,6 +31,7 @@ #include "BLI_linklist.h" #include "BLI_math.h" #include "BLI_stack.h" +#include "BLI_string_utils.h" #include "BLI_task.h" #include "BLI_threads.h" #include "BLI_utildefines.h" @@ -3542,9 +3543,10 @@ static void filelist_readjob_recursive_dir_add_items(const bool do_lib, LISTBASE_FOREACH (FileListInternEntry *, entry, &entries) { entry->uid = filelist_uid_generate(filelist); - /* When loading entries recursive, the rel_path should be relative from the root dir. - * we combine the relative path to the subdir with the relative path of the entry. */ - BLI_path_join(dir, sizeof(dir), rel_subdir, entry->relpath); + /* When loading entries recursive, the `rel_path` should be relative from the root dir. + * we combine the relative path to the `subdir` with the relative path of the entry. + * Using #BLI_path_join works but isn't needed as `rel_subdir` has a trailing slash. */ + BLI_string_join(dir, sizeof(dir), rel_subdir, entry->relpath); MEM_freeN(entry->relpath); entry->relpath = BLI_strdup(dir + 2); /* + 2 to remove '//' * added by BLI_path_rel to rel_subdir. */ @@ -3553,8 +3555,9 @@ static void filelist_readjob_recursive_dir_add_items(const bool do_lib, 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_path_join(dir, sizeof(dir), root, entry->relpath); + /* We have a directory we want to list, add it to todo list! + * Using #BLI_path_join works but isn't needed as `root` has a trailing slash. */ + BLI_string_join(dir, sizeof(dir), root, entry->relpath); BLI_path_normalize_dir(job_params->main_name, dir, sizeof(dir)); td_dir = static_cast<TodoDir *>(BLI_stack_push_r(todo_dirs)); td_dir->level = recursion_level + 1; |