At last... this merge should finally do the trick!
[blender.git] / source / blender / editors / space_outliner / outliner.c
index eba0aa84e85d902cc1262aa005da73ef79d2ae3c..6563a7dc7df77c8622480bbbc2dc26f232846b25 100644 (file)
@@ -1031,7 +1031,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
        }
        else if(ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
                PointerRNA pptr, propptr, *ptr= (PointerRNA*)idv;
-               PropertyRNA *prop, *iterprop, *nameprop;
+               PropertyRNA *prop, *iterprop;
                PropertyType proptype;
                PropertySubType propsubtype;
                int a, tot;
@@ -1043,12 +1043,10 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                }
                else if(type == TSE_RNA_STRUCT) {
                        /* struct */
-                       nameprop= RNA_struct_name_property(ptr->type);
+                       te->name= RNA_struct_name_get_alloc(ptr, NULL, 0);
 
-                       if(nameprop) {
-                               te->name= RNA_property_string_get_alloc(ptr, nameprop, NULL, 0);
+                       if(te->name)
                                te->flag |= TE_FREE_NAME;
-                       }
                        else
                                te->name= (char*)RNA_struct_ui_name(ptr->type);
 
@@ -3075,7 +3073,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
        TreeElement *tem, *temnext, *temsub;
        TreeStoreElem *tse, *tsenext;
        PointerRNA *ptr, *nextptr;
-       PropertyRNA *prop, *nameprop;
+       PropertyRNA *prop;
        char *newpath=NULL;
        
        /* optimise tricks:
@@ -3119,17 +3117,16 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
                                        newpath= RNA_path_append(*path, ptr, prop, 0, NULL);
                                }
                                else if(RNA_property_type(prop) == PROP_COLLECTION) {
+                                       char buf[128], *name;
+
                                        temnext= (TreeElement*)(ld->next->data);
                                        tsenext= TREESTORE(temnext);
                                        
                                        nextptr= &temnext->rnaptr;
-                                       nameprop= RNA_struct_name_property(nextptr->type);
+                                       name= RNA_struct_name_get_alloc(nextptr, buf, sizeof(buf));
                                        
-                                       if(nameprop) {
+                                       if(name) {
                                                /* if possible, use name as a key in the path */
-                                               char buf[128], *name;
-                                               name= RNA_property_string_get_alloc(nextptr, nameprop, buf, sizeof(buf));
-                                               
                                                newpath= RNA_path_append(*path, NULL, prop, 0, name);
                                                
                                                if(name != buf)