From df6b0af04a8fa43388403190497607484aa29885 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 22 Dec 2012 14:04:09 +0000 Subject: [PATCH] replace RNA_ID_type_name() with BKE_idcode_to_name_plural() --- source/blender/editors/space_outliner/outliner_tree.c | 6 +++++- source/blender/makesrna/RNA_access.h | 2 -- source/blender/makesrna/intern/rna_main_api.c | 9 --------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index ca2168020cd..12f79ec999d 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -69,6 +69,7 @@ #include "BKE_library.h" #include "BKE_modifier.h" #include "BKE_sequencer.h" +#include "BKE_idcode.h" #include "ED_armature.h" #include "ED_screen.h" @@ -1598,7 +1599,10 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops) ten = outliner_add_element(soops, &soops->tree, (void *)lbarray[a], NULL, TSE_ID_BASE, 0); ten->directdata = lbarray[a]; - ten->name = (char *)RNA_ID_type_name(GS(id->name)); + ten->name = (char *)BKE_idcode_to_name_plural(GS(id->name)); + if (UNLIKELY(ten->name == NULL)) { + ten->name = "UNKNOWN"; + } for (; id; id = id->next) { outliner_add_element(soops, &ten->subtree, id, ten, 0, 0); diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index d7dad1757f0..5f4e4ce4259 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -1039,8 +1039,6 @@ int RNA_function_call_direct_va_lookup(struct bContext *C, struct ReportList *re short RNA_type_to_ID_code(StructRNA *type); StructRNA *ID_code_to_RNA_type(short idcode); -const char *RNA_ID_type_name(short type); - #define RNA_POINTER_INVALIDATE(ptr) { \ /* this is checked for validity */ \ diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index fac330fc243..cc74fce1733 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -198,15 +198,6 @@ static Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, co return ob; } -/* exported for non-rna use cases */ -const char *RNA_ID_type_name(short type) -{ - const char *idname; - if (RNA_enum_id_from_value(id_type_items, type, &idname) == 0) - idname = "UNKNOWN"; - return idname; -} - static void rna_Main_objects_remove(Main *bmain, ReportList *reports, PointerRNA *object_ptr) { Object *object = object_ptr->data;