diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-23 02:54:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-06-23 04:29:36 +0300 |
commit | 716a8241d387180fd8ad69cdec33633bc7a0f963 (patch) | |
tree | d4674969beacfa6f9d50726f5943e050a373f2b5 /source/blender/editors/space_outliner | |
parent | a573d7e8a14ce5e49b8c05ff762a00e181e905aa (diff) |
Cleanup: rename 'name' to 'filepath' for DNA types
Using 'name' for the full path of a file reads badly,
especially when id.name is used in related code.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_edit.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 4 |
3 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 93c7a4f4ed4..7009d416e91 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -709,9 +709,9 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname) Library *lib = (Library *)tselem->id; char expanded[FILE_MAX]; - BKE_library_filepath_set(bmain, lib, lib->name); + BKE_library_filepath_set(bmain, lib, lib->filepath); - BLI_strncpy(expanded, lib->name, sizeof(expanded)); + BLI_strncpy(expanded, lib->filepath, sizeof(expanded)); BLI_path_abs(expanded, BKE_main_blendfile_path(bmain)); if (!BLI_exists(expanded)) { BKE_reportf(CTX_wm_reports(C), @@ -1842,7 +1842,7 @@ static void outliner_buttons(const bContext *C, len = sizeof(((ModifierData *)0)->name); } else if (tselem->id && GS(tselem->id->name) == ID_LI) { - len = sizeof(((Library *)0)->name); + len = sizeof(((Library *)0)->filepath); } else { len = MAX_ID_NAME - 2; @@ -2681,7 +2681,7 @@ static void tselem_draw_icon(uiBlock *block, 0.0, 1.0, alpha, - (data.drag_id && ID_IS_LINKED(data.drag_id)) ? data.drag_id->lib->name : ""); + (data.drag_id && ID_IS_LINKED(data.drag_id)) ? data.drag_id->lib->filepath : ""); } } diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 73323563cde..bee8b28e658 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -915,8 +915,9 @@ static int lib_relocate( printf("%s, %s\n", tselem->id->name, lib->filepath_abs); - /* We assume if both paths in lib are not the same then lib->name was relative... */ - RNA_boolean_set(&op_props, "relative_path", BLI_path_cmp(lib->filepath_abs, lib->name) != 0); + /* We assume if both paths in lib are not the same then `lib->filepath` was relative. */ + RNA_boolean_set( + &op_props, "relative_path", BLI_path_cmp(lib->filepath_abs, lib->filepath) != 0); RNA_string_set(&op_props, "directory", dir); RNA_string_set(&op_props, "filename", filename); diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 7d685be107c..f07bb800eca 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -549,7 +549,7 @@ static void outliner_add_id_contents(SpaceOutliner *soops, /* expand specific data always */ switch (GS(id->name)) { case ID_LI: { - te->name = ((Library *)id)->name; + te->name = ((Library *)id)->filepath; break; } case ID_SCE: { @@ -870,7 +870,7 @@ static TreeElement *outliner_add_element( else { /* do here too, for blend file viewer, own ID_LI then shows file name */ if (GS(id->name) == ID_LI) { - te->name = ((Library *)id)->name; + te->name = ((Library *)id)->filepath; } else { te->name = id->name + 2; // default, can be overridden by Library or non-ID data |