diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-24 08:33:32 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-24 08:54:01 +0300 |
commit | 4682a0882f02c50b20aa3c4bf9abe9f7ec2e834b (patch) | |
tree | 36dc6fb09eaa1d539e516875ed957aba5334666e /source/blender/editors | |
parent | 5058c4b1446f58bb9a5ddcb65f7353d9df3a594a (diff) |
Cleanup: use "filepath" instead of "filename" for full paths
Reserve "filename" when only the name component is used.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/curve/editfont.c | 22 | ||||
-rw-r--r-- | source/blender/editors/physics/dynamicpaint_ops.c | 14 |
2 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 0afb1c2f4af..611dbb2e80c 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -526,16 +526,16 @@ static bool font_paste_utf8(bContext *C, const char *str, const size_t str_len) /** \name Paste From File Operator * \{ */ -static int paste_from_file(bContext *C, ReportList *reports, const char *filename) +static int paste_from_file(bContext *C, ReportList *reports, const char *filepath) { Object *obedit = CTX_data_edit_object(C); char *strp; size_t filelen; int retval; - strp = BLI_file_read_text_as_mem(filename, 1, &filelen); + strp = BLI_file_read_text_as_mem(filepath, 1, &filelen); if (strp == NULL) { - BKE_reportf(reports, RPT_ERROR, "Failed to open file '%s'", filename); + BKE_reportf(reports, RPT_ERROR, "Failed to open file '%s'", filepath); return OPERATOR_CANCELLED; } strp[filelen] = 0; @@ -545,7 +545,7 @@ static int paste_from_file(bContext *C, ReportList *reports, const char *filenam retval = OPERATOR_FINISHED; } else { - BKE_reportf(reports, RPT_ERROR, "File too long %s", filename); + BKE_reportf(reports, RPT_ERROR, "File too long %s", filepath); retval = OPERATOR_CANCELLED; } @@ -556,12 +556,12 @@ static int paste_from_file(bContext *C, ReportList *reports, const char *filenam static int paste_from_file_exec(bContext *C, wmOperator *op) { - char *path; + char *filepath; int retval; - path = RNA_string_get_alloc(op->ptr, "filepath", NULL, 0, NULL); - retval = paste_from_file(C, op->reports, path); - MEM_freeN(path); + filepath = RNA_string_get_alloc(op->ptr, "filepath", NULL, 0, NULL); + retval = paste_from_file(C, op->reports, filepath); + MEM_freeN(filepath); return retval; } @@ -2091,7 +2091,7 @@ static int font_open_exec(bContext *C, wmOperator *op) static int open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { VFont *vfont = NULL; - const char *path; + const char *filepath; PointerRNA idptr; PropertyPointerRNA *pprop; @@ -2106,13 +2106,13 @@ static int open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event) vfont = (VFont *)idptr.owner_id; } - path = (vfont && !BKE_vfont_is_builtin(vfont)) ? vfont->filepath : U.fontdir; + filepath = (vfont && !BKE_vfont_is_builtin(vfont)) ? vfont->filepath : U.fontdir; if (RNA_struct_property_is_set(op->ptr, "filepath")) { return font_open_exec(C, op); } - RNA_string_set(op->ptr, "filepath", path); + RNA_string_set(op->ptr, "filepath", filepath); WM_event_add_fileselect(C, op); return OPERATOR_RUNNING_MODAL; diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c index 5bc062eb177..e8ceb97ed7a 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.c +++ b/source/blender/editors/physics/dynamicpaint_ops.c @@ -399,27 +399,27 @@ static void dynamicPaint_bakeImageSequence(DynamicPaintBakeJob *job) * Save output images */ { - char filename[FILE_MAX]; + char filepath[FILE_MAX]; /* primary output layer */ if (surface->flags & MOD_DPAINT_OUT1) { /* set filepath */ BLI_join_dirfile( - filename, sizeof(filename), surface->image_output_path, surface->output_name); - BLI_path_frame(filename, frame, 4); + filepath, sizeof(filepath), surface->image_output_path, surface->output_name); + BLI_path_frame(filepath, frame, 4); /* save image */ - dynamicPaint_outputSurfaceImage(surface, filename, 0); + dynamicPaint_outputSurfaceImage(surface, filepath, 0); } /* secondary output */ if (surface->flags & MOD_DPAINT_OUT2 && surface->type == MOD_DPAINT_SURFACE_T_PAINT) { /* set filepath */ BLI_join_dirfile( - filename, sizeof(filename), surface->image_output_path, surface->output_name2); - BLI_path_frame(filename, frame, 4); + filepath, sizeof(filepath), surface->image_output_path, surface->output_name2); + BLI_path_frame(filepath, frame, 4); /* save image */ - dynamicPaint_outputSurfaceImage(surface, filename, 1); + dynamicPaint_outputSurfaceImage(surface, filepath, 1); } } } |