Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-03-07 05:23:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-07 05:26:23 +0300
commit0964865568802aba62737d899d6721ef5c58b63a (patch)
tree7e85df6a34a192085f94d181ba53d268bc6c1632 /source/blender/editors/space_file/file_ops.c
parent8fb1ea857ffef370acb020f6573c165100923e1b (diff)
Cleanup: replace BLI_make_file_string with BLI_join_dirfile where possible
Use 'BLI_join_dirfile' for joining paths that don't need to expand '//'.
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r--source/blender/editors/space_file/file_ops.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index e03d15d9f34..5004bb8dd77 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -948,8 +948,10 @@ static int bookmark_add_exec(bContext *C, wmOperator *UNUSED(op))
fsmenu_insert_entry(
fsmenu, FS_CATEGORY_BOOKMARKS, params->dir, NULL, ICON_FILE_FOLDER, FS_INSERT_SAVE);
- BLI_make_file_string(
- "/", name, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
+ BLI_join_dirfile(name,
+ sizeof(name),
+ BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL),
+ BLENDER_BOOKMARK_FILE);
fsmenu_write_file(fsmenu, name);
}
@@ -991,10 +993,10 @@ static int bookmark_delete_exec(bContext *C, wmOperator *op)
char name[FILE_MAX];
fsmenu_remove_entry(fsmenu, FS_CATEGORY_BOOKMARKS, index);
- BLI_make_file_string("/",
- name,
- BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL),
- BLENDER_BOOKMARK_FILE);
+ BLI_join_dirfile(name,
+ sizeof(name),
+ BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL),
+ BLENDER_BOOKMARK_FILE);
fsmenu_write_file(fsmenu, name);
ED_area_tag_refresh(sa);
ED_area_tag_redraw(sa);
@@ -1045,8 +1047,10 @@ static int bookmark_cleanup_exec(bContext *C, wmOperator *UNUSED(op))
if (changed) {
char name[FILE_MAX];
- BLI_make_file_string(
- "/", name, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
+ BLI_join_dirfile(name,
+ sizeof(name),
+ BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL),
+ BLENDER_BOOKMARK_FILE);
fsmenu_write_file(fsmenu, name);
fsmenu_refresh_bookmarks_status(CTX_wm_manager(C), fsmenu);
ED_area_tag_refresh(sa);
@@ -1122,8 +1126,10 @@ static int bookmark_move_exec(bContext *C, wmOperator *op)
/* Need to update active bookmark number. */
sfile->bookmarknr = new_index;
- BLI_make_file_string(
- "/", fname, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
+ BLI_join_dirfile(fname,
+ sizeof(fname),
+ BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL),
+ BLENDER_BOOKMARK_FILE);
fsmenu_write_file(fsmenu, fname);
ED_area_tag_redraw(sa);
@@ -1168,8 +1174,10 @@ static int reset_recent_exec(bContext *C, wmOperator *UNUSED(op))
while (ED_fsmenu_get_entry(fsmenu, FS_CATEGORY_RECENT, 0) != NULL) {
fsmenu_remove_entry(fsmenu, FS_CATEGORY_RECENT, 0);
}
- BLI_make_file_string(
- "/", name, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
+ BLI_join_dirfile(name,
+ sizeof(name),
+ BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL),
+ BLENDER_BOOKMARK_FILE);
fsmenu_write_file(fsmenu, name);
ED_area_tag_redraw(sa);
@@ -1571,10 +1579,10 @@ int file_exec(bContext *C, wmOperator *exec_op)
FS_INSERT_SAVE | FS_INSERT_FIRST);
}
- BLI_make_file_string(BKE_main_blendfile_path(bmain),
- filepath,
- BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL),
- BLENDER_BOOKMARK_FILE);
+ BLI_join_dirfile(filepath,
+ sizeof(filepath),
+ BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL),
+ BLENDER_BOOKMARK_FILE);
fsmenu_write_file(ED_fsmenu_get(), filepath);
WM_event_fileselect_event(wm, op, EVT_FILESELECT_EXEC);
}