Cleanup: rename BKE_libblock_delete to BKE_id_delete.

This commit is contained in:
Bastien Montagne 2019-01-14 21:24:25 +01:00
parent f55a178db0
commit 01029c68d2
11 changed files with 15 additions and 16 deletions

View File

@ -140,23 +140,22 @@ enum {
LIB_ID_FREE_NO_UI_USER = 1 << 9, /* Do not attempt to remove freed ID from UI data/notifiers/... */
};
void BKE_libblock_free_datablock(struct ID *id, const int flag) ATTR_NONNULL();
void BKE_libblock_free_data(struct ID *id, const bool do_id_user) ATTR_NONNULL();
void BKE_id_free_ex(struct Main *bmain, void *idv, int flag, const bool use_flag_from_idtag);
void BKE_id_free(struct Main *bmain, void *idv);
void BKE_id_free_us(struct Main *bmain, void *idv) ATTR_NONNULL();
void BKE_id_delete(struct Main *bmain, void *idv) ATTR_NONNULL();
void BKE_libblock_management_main_add(struct Main *bmain, void *idv);
void BKE_libblock_management_main_remove(struct Main *bmain, void *idv);
void BKE_libblock_management_usercounts_set(struct Main *bmain, void *idv);
void BKE_libblock_management_usercounts_clear(struct Main *bmain, void *idv);
/* TODO should be named "BKE_id_delete()". */
void BKE_libblock_delete(struct Main *bmain, void *idv) ATTR_NONNULL();
void BKE_libblock_free_datablock(struct ID *id, const int flag) ATTR_NONNULL();
void BKE_libblock_free_data(struct ID *id, const bool do_id_user) ATTR_NONNULL();
void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID *id);
void id_lib_extern(struct ID *id);
void BKE_library_filepath_set(struct Main *bmain, struct Library *lib, const char *filepath);

View File

@ -476,7 +476,7 @@ void BKE_blendfile_read_make_empty(bContext *C)
continue;
}
while ((id = lbarray[a]->first)) {
BKE_libblock_delete(bmain, id);
BKE_id_delete(bmain, id);
}
}
}

View File

@ -173,7 +173,7 @@ bool BKE_collection_delete(Main *bmain, Collection *collection, bool hierarchy)
}
}
BKE_libblock_delete(bmain, collection);
BKE_id_delete(bmain, collection);
BKE_main_collection_sync(bmain);

View File

@ -946,7 +946,7 @@ void BKE_id_free_us(Main *bmain, void *idv) /* test users */
}
}
void BKE_libblock_delete(Main *bmain, void *idv)
void BKE_id_delete(Main *bmain, void *idv)
{
ListBase *lbarray[MAX_LIBARRAY];
int base_count, i;

View File

@ -65,7 +65,7 @@ public:
if (reference && reference->id.us == 0)
{
Main *bmain = CTX_data_main(mContext);
BKE_libblock_delete(bmain, &reference->id);
BKE_id_delete(bmain, &reference->id);
}
curve_map.clear();
}

View File

@ -1361,7 +1361,7 @@ static int object_delete_exec(bContext *C, wmOperator *op)
*/
if (use_global && ob->id.lib == NULL) {
/* We want to nuke the object, let's nuke it the easy way (not for linked data though)... */
BKE_libblock_delete(bmain, &ob->id);
BKE_id_delete(bmain, &ob->id);
changed_count += 1;
continue;
}

View File

@ -538,7 +538,7 @@ static int collection_unlink_exec(bContext *C, wmOperator *UNUSED(op))
if (!collection)
return OPERATOR_CANCELLED;
BKE_libblock_delete(bmain, collection);
BKE_id_delete(bmain, collection);
DEG_relations_tag_update(bmain);

View File

@ -379,7 +379,7 @@ static void id_delete(bContext *C, ReportList *reports, TreeElement *te, TreeSto
}
BKE_libblock_delete(bmain, id);
BKE_id_delete(bmain, id);
WM_event_add_notifier(C, NC_WINDOW, NULL);
}

View File

@ -387,7 +387,7 @@ static int text_unlink_exec(bContext *C, wmOperator *UNUSED(op))
}
}
BKE_libblock_delete(bmain, text);
BKE_id_delete(bmain, text);
text_drawcache_tag_update(st, 1);
WM_event_add_notifier(C, NC_TEXT | NA_REMOVED, NULL);

View File

@ -84,7 +84,7 @@ public:
Text *text = BKE_text_load(&_freestyle_bmain, fn, G_MAIN->name);
if (text) {
ok = BPY_execute_text(_context, text, reports, false);
BKE_libblock_delete(&_freestyle_bmain, text);
BKE_id_delete(&_freestyle_bmain, text);
}
else {
BKE_reportf(reports, RPT_ERROR, "Cannot open file: %s", fn);

View File

@ -133,7 +133,7 @@ static void rna_Main_ID_remove(
{
ID *id = id_ptr->data;
if (do_unlink) {
BKE_libblock_delete(bmain, id);
BKE_id_delete(bmain, id);
RNA_POINTER_INVALIDATE(id_ptr);
}
else if (ID_REAL_USERS(id) <= 0) {