Refactor: Reduce File Browser Sorting #119103

Closed
Harley Acheson wants to merge 3 commits from Harley/blender:FileSorting into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 4 additions and 4 deletions

View File

@ -143,7 +143,7 @@ static void bli_builddir(BuildDirCtx *dir_ctx, const char *dirname)
else if (FILENAME_IS_CURRENT(dlink->name)) {
has_current = true;
}
BLI_addhead(&dirbase, dlink);
BLI_addtail(&dirbase, dlink);
newnum++;
}
}
@ -156,7 +156,7 @@ static void bli_builddir(BuildDirCtx *dir_ctx, const char *dirname)
dirlink *const dlink = (dirlink *)malloc(sizeof(dirlink));
if (dlink != nullptr) {
dlink->name = BLI_strdup(FILENAME_PARENT);
BLI_addhead(&dirbase, dlink);
BLI_addtail(&dirbase, dlink);
newnum++;
}
}
@ -165,7 +165,7 @@ static void bli_builddir(BuildDirCtx *dir_ctx, const char *dirname)
dirlink *const dlink = (dirlink *)malloc(sizeof(dirlink));
if (dlink != nullptr) {
dlink->name = BLI_strdup(FILENAME_CURRENT);
BLI_addhead(&dirbase, dlink);
BLI_addtail(&dirbase, dlink);
newnum++;
}
}

View File

@ -3135,7 +3135,7 @@ static int filelist_readjob_list_dir(FileListReadJob *job_params,
}
#endif
BLI_addtail(entries, entry);
BLI_addhead(entries, entry);
entries_num++;
Harley marked this conversation as resolved Outdated

It looks like moving the if (files) check is an unrelated cleanup? The diff would be clearer without that.

It looks like moving the `if (files)` check is an unrelated cleanup? The diff would be clearer without that.
}
BLI_filelist_free(files, files_num);