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/makesrna | |
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/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_image_api.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_text.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 55d365f9827..0b188b2b3db 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -102,14 +102,14 @@ static void rna_Image_save(Image *image, Main *bmain, bContext *C, ReportList *r ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, &lock); if (ibuf) { - char filename[FILE_MAX]; - BLI_strncpy(filename, image->filepath, sizeof(filename)); - BLI_path_abs(filename, ID_BLEND_PATH(bmain, &image->id)); + char filepath[FILE_MAX]; + BLI_strncpy(filepath, image->filepath, sizeof(filepath)); + BLI_path_abs(filepath, ID_BLEND_PATH(bmain, &image->id)); /* NOTE: we purposefully ignore packed files here, * developers need to explicitly write them via 'packed_files' */ - if (IMB_saveiff(ibuf, filename, ibuf->flags)) { + if (IMB_saveiff(ibuf, filepath, ibuf->flags)) { image->type = IMA_TYPE_IMAGE; if (image->source == IMA_SRC_GENERATED) { diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c index 3d2df5b7411..e9c67d71ceb 100644 --- a/source/blender/makesrna/intern/rna_text.c +++ b/source/blender/makesrna/intern/rna_text.c @@ -25,7 +25,7 @@ #ifdef RNA_RUNTIME -static void rna_Text_filename_get(PointerRNA *ptr, char *value) +static void rna_Text_filepath_get(PointerRNA *ptr, char *value) { Text *text = (Text *)ptr->data; @@ -37,13 +37,13 @@ static void rna_Text_filename_get(PointerRNA *ptr, char *value) } } -static int rna_Text_filename_length(PointerRNA *ptr) +static int rna_Text_filepath_length(PointerRNA *ptr) { Text *text = (Text *)ptr->data; return (text->filepath) ? strlen(text->filepath) : 0; } -static void rna_Text_filename_set(PointerRNA *ptr, const char *value) +static void rna_Text_filepath_set(PointerRNA *ptr, const char *value) { Text *text = (Text *)ptr->data; @@ -204,7 +204,7 @@ static void rna_def_text(BlenderRNA *brna) prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs( - prop, "rna_Text_filename_get", "rna_Text_filename_length", "rna_Text_filename_set"); + prop, "rna_Text_filepath_get", "rna_Text_filepath_length", "rna_Text_filepath_set"); RNA_def_property_ui_text(prop, "File Path", "Filename of the text file"); prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE); |