diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-03-07 05:49:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-07 05:52:41 +0300 |
commit | ef5c6361a57acfb86de3b137581c968b769e3383 (patch) | |
tree | 0d9cc22d483493206637176dd2896ac02fa483c0 /source/blender/editors/space_file/file_ops.c | |
parent | 0964865568802aba62737d899d6721ef5c58b63a (diff) |
Cleanup: replace BLI_make_file_string with BLI_join_dirfile for the file-selector
In these cases the file selectors directory is already expanded.
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 5004bb8dd77..d72bc31e656 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -2489,22 +2489,19 @@ static bool file_delete_poll(bContext *C) int file_delete_exec(bContext *C, wmOperator *op) { - char str[FILE_MAX]; - Main *bmain = CTX_data_main(C); wmWindowManager *wm = CTX_wm_manager(C); SpaceFile *sfile = CTX_wm_space_file(C); ScrArea *sa = CTX_wm_area(C); - FileDirEntry *file; int numfiles = filelist_files_ensure(sfile->files); - int i; const char *error_message = NULL; bool report_error = false; errno = 0; - for (i = 0; i < numfiles; i++) { + for (int i = 0; i < numfiles; i++) { if (filelist_entry_select_index_get(sfile->files, i, CHECK_ALL)) { - file = filelist_file(sfile->files, i); - BLI_make_file_string(BKE_main_blendfile_path(bmain), str, sfile->params->dir, file->relpath); + FileDirEntry *file = filelist_file(sfile->files, i); + char str[FILE_MAX]; + BLI_join_dirfile(str, sizeof(str), sfile->params->dir, file->relpath); if (BLI_delete_soft(str, &error_message) != 0 || BLI_exists(str)) { report_error = true; } |