replace RNA_ID_type_name() with BKE_idcode_to_name_plural()
authorCampbell Barton <ideasman42@gmail.com>
Sat, 22 Dec 2012 14:04:09 +0000 (14:04 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 22 Dec 2012 14:04:09 +0000 (14:04 +0000)
source/blender/editors/space_outliner/outliner_tree.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_main_api.c

index ca2168020cd5b87e34d9e851304ed6bfa56b46fa..12f79ec999d8ca8842f5acd0f9c00ab152c56c9e 100644 (file)
@@ -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);
index d7dad1757f0f20b95e43661e7274bbf0fe064880..5f4e4ce4259424a785280d3afb0b13e4ca1a3bd3 100644 (file)
@@ -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 */                                        \
index fac330fc243617c40061cc44473f6064e478f976..cc74fce1733a1890433bf701b8e834a7fd6d1cc2 100644 (file)
@@ -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;