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-06-23 02:54:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-06-23 04:22:30 +0300
commita573d7e8a14ce5e49b8c05ff762a00e181e905aa (patch)
tree3edceaa599e3c9755e0512c6e343f9e3a4c4139b /source/blender/windowmanager
parent58f3fabb97f9bb84e7b324dabd0ec4abc03f5cfe (diff)
Cleanup: rename Library.filepath to filepath_abs
Make it clear that this is the absolute path, allow the 'name' to be renamed to 'filepath'. Rename is safe since this is only for run-time.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c2
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c20
2 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 903fafeef2d..d08636e826c 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1458,7 +1458,7 @@ static bool wm_file_write(bContext *C,
/* send the OnSave event */
for (li = bmain->libraries.first; li; li = li->id.next) {
- if (BLI_path_cmp(li->filepath, filepath) == 0) {
+ if (BLI_path_cmp(li->filepath_abs, filepath) == 0) {
BKE_reportf(reports, RPT_ERROR, "Cannot overwrite used library '%.240s'", filepath);
return ok;
}
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index 3ffd6c4a334..c8574a5a7fb 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -681,10 +681,10 @@ static int wm_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEvent *UN
BKE_reportf(op->reports,
RPT_ERROR_INVALID_INPUT,
"Cannot relocate indirectly linked library '%s'",
- lib->filepath);
+ lib->filepath_abs);
return OPERATOR_CANCELLED;
}
- RNA_string_set(op->ptr, "filepath", lib->filepath);
+ RNA_string_set(op->ptr, "filepath", lib->filepath_abs);
WM_event_add_fileselect(C, op);
@@ -913,24 +913,24 @@ static void lib_relocate_do(Main *bmain,
void WM_lib_reload(Library *lib, bContext *C, ReportList *reports)
{
- if (!BLO_has_bfile_extension(lib->filepath)) {
- BKE_reportf(reports, RPT_ERROR, "'%s' is not a valid library filepath", lib->filepath);
+ if (!BLO_has_bfile_extension(lib->filepath_abs)) {
+ BKE_reportf(reports, RPT_ERROR, "'%s' is not a valid library filepath", lib->filepath_abs);
return;
}
- if (!BLI_exists(lib->filepath)) {
+ if (!BLI_exists(lib->filepath_abs)) {
BKE_reportf(reports,
RPT_ERROR,
"Trying to reload library '%s' from invalid path '%s'",
lib->id.name,
- lib->filepath);
+ lib->filepath_abs);
return;
}
WMLinkAppendData *lapp_data = wm_link_append_data_new(BLO_LIBLINK_USE_PLACEHOLDERS |
BLO_LIBLINK_FORCE_INDIRECT);
- wm_link_append_data_library_add(lapp_data, lib->filepath);
+ wm_link_append_data_library_add(lapp_data, lib->filepath_abs);
lib_relocate_do(CTX_data_main(C), lib, lapp_data, reports, true);
@@ -963,7 +963,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload)
BKE_reportf(op->reports,
RPT_ERROR_INVALID_INPUT,
"Cannot relocate indirectly linked library '%s'",
- lib->filepath);
+ lib->filepath_abs);
return OPERATOR_CANCELLED;
}
@@ -986,7 +986,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload)
return OPERATOR_CANCELLED;
}
- if (BLI_path_cmp(lib->filepath, path) == 0) {
+ if (BLI_path_cmp(lib->filepath_abs, path) == 0) {
#ifdef PRINT_DEBUG
printf("We are supposed to reload '%s' lib (%d)...\n", lib->filepath, lib->id.us);
#endif
@@ -1023,7 +1023,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload)
BLI_join_dirfile(path, sizeof(path), root, relname);
- if (BLI_path_cmp(path, lib->filepath) == 0 || !BLO_has_bfile_extension(relname)) {
+ if (BLI_path_cmp(path, lib->filepath_abs) == 0 || !BLO_has_bfile_extension(relname)) {
continue;
}