diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-13 08:22:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-13 08:22:19 +0300 |
commit | 8ad2642c4717dcfad31626f7eebac325a9827b73 (patch) | |
tree | 2d2ba09f1cd3849adb45eb51a590783a5a9eca02 /source/blender/windowmanager/intern/wm_files.c | |
parent | 27231afce5e4d0832113415f4d3cdeed480b165f (diff) |
Cleanup: use "filepath" term for Main, BlendFileData & FileGlobal
Use "filepath" which is the current convention for naming full paths.
- Main use "name" which isn't obviously a file path.
- BlendFileData & FileGlobal used "filename" which is often
used for the name component of a path (without the directory).
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index a2a09f9b0bc..e753c083805 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -1356,7 +1356,7 @@ void wm_homefile_read_ex(bContext *C, if (use_data) { WM_check(C); /* opens window(s), checks keymaps */ - bmain->name[0] = '\0'; + bmain->filepath[0] = '\0'; /* start with save preference untitled.blend */ G.save_over = 0; @@ -1828,7 +1828,7 @@ static bool wm_file_write(bContext *C, /* First time saving. */ /* XXX(ton): temp solution to solve bug, real fix coming. */ if ((BKE_main_blendfile_path(bmain)[0] == '\0') && (use_save_as_copy == false)) { - BLI_strncpy(bmain->name, filepath, sizeof(bmain->name)); + STRNCPY(bmain->filepath, filepath); } /* XXX(ton): temp solution to solve bug, real fix coming. */ @@ -1849,7 +1849,7 @@ static bool wm_file_write(bContext *C, if (use_save_as_copy == false) { G.relbase_valid = 1; - BLI_strncpy(bmain->name, filepath, sizeof(bmain->name)); /* is guaranteed current file */ + STRNCPY(bmain->filepath, filepath); /* is guaranteed current file */ G.save_over = 1; /* disable untitled.blend convention */ } @@ -3035,21 +3035,21 @@ static void save_set_filepath(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); PropertyRNA *prop; - char name[FILE_MAX]; + char filepath[FILE_MAX]; prop = RNA_struct_find_property(op->ptr, "filepath"); if (!RNA_property_is_set(op->ptr, prop)) { /* if not saved before, get the name of the most recently used .blend file */ if (BKE_main_blendfile_path(bmain)[0] == '\0' && G.recent_files.first) { struct RecentFile *recent = G.recent_files.first; - BLI_strncpy(name, recent->filepath, FILE_MAX); + STRNCPY(filepath, recent->filepath); } else { - BLI_strncpy(name, bmain->name, FILE_MAX); + STRNCPY(filepath, bmain->filepath); } - wm_filepath_default(name); - RNA_property_string_set(op->ptr, prop, name); + wm_filepath_default(filepath); + RNA_property_string_set(op->ptr, prop, filepath); } } |