From bde19b57d61968b661b568be896ead91f90cc708 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 16 Jun 2016 15:49:10 +0200 Subject: Cleanup from review comments. --- source/blender/windowmanager/intern/wm_files_link.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index ad5afdabc85..a4dea8165b2 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -591,7 +591,9 @@ static void lib_relocate_do(Main *bmain, WMLinkAppendData *lapp_data, ReportList BLI_assert(new_id); } if (new_id) { -// printf("before remap, old_id users: %d, new_id users: %d\n", old_id->us, new_id->us); +#ifdef PRINT_DEBUG + printf("before remap, old_id users: %d, new_id users: %d\n", old_id->us, new_id->us); +#endif BKE_libblock_remap_locked(bmain, old_id, new_id, remap_flags); if (old_id->flag & LIB_FAKEUSER) { @@ -599,7 +601,9 @@ static void lib_relocate_do(Main *bmain, WMLinkAppendData *lapp_data, ReportList id_fake_user_set(new_id); } -// printf("after remap, old_id users: %d, new_id users: %d\n", old_id->us, new_id->us); +#ifdef PRINT_DEBUG + printf("after remap, old_id users: %d, new_id users: %d\n", old_id->us, new_id->us); +#endif /* In some cases, new_id might become direct link, remove parent of library in this case. */ if (new_id->lib->parent && (new_id->tag & LIB_TAG_INDIRECT) == 0) { @@ -737,7 +741,9 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload) BLI_join_dirfile(path, sizeof(path), root, libname); if (BLI_path_cmp(lib->filepath, path) == 0) { +#ifdef PRINT_DEBUG printf("We are supposed to reload '%s' lib (%d)...\n", lib->filepath, lib->id.us); +#endif do_reload = true; @@ -747,7 +753,9 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload) else { int totfiles = 0; +#ifdef PRINT_DEBUG printf("We are supposed to relocate '%s' lib to new '%s' one...\n", lib->filepath, libname); +#endif /* Check if something is indicated for relocate. */ prop = RNA_struct_find_property(op->ptr, "files"); @@ -774,13 +782,17 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload) continue; } +#ifdef PRINT_DEBUG printf("\t candidate new lib to reload datablocks from: %s\n", path); +#endif wm_link_append_data_library_add(lapp_data, path); } RNA_END; } else { +#ifdef PRINT_DEBUG printf("\t candidate new lib to reload datablocks from: %s\n", path); +#endif wm_link_append_data_library_add(lapp_data, path); } } @@ -805,7 +817,9 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload) item = wm_link_append_data_item_add(lapp_data, id->name + 2, idcode, id); BLI_BITMAP_SET_ALL(item->libraries, true, lapp_data->num_libraries); +#ifdef PRINT_DEBUG printf("\tdatablock to seek for: %s\n", id->name); +#endif } } } -- cgit v1.2.3