Revert "Add library-hint to datablock search menus."
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 27 Feb 2019 15:39:01 +0000 (16:39 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 27 Feb 2019 15:44:49 +0000 (16:44 +0100)
This reverts commit 4669c3692cc4f69660c673ceccce2245d5b9fed8.

source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c

index 0d7dbd0d4417e32730b306563280d6cda53285d0..0d2a7248a2edf3bde0a54cf808fe5c2a51d470ab 100644 (file)
@@ -295,8 +295,8 @@ static bool id_search_add(
                }
 
                if (*str == '\0' || BLI_strcasestr(id->name + 2, str)) {
                }
 
                if (*str == '\0' || BLI_strcasestr(id->name + 2, str)) {
-                       /* +1 is needed because BKE_id_ui_prefix uses 3 letter prefix
-                        * followed by ID_NAME-2 characters from id->name.
+                       /* +1 is needed because BKE_id_ui_prefix used 3 letter prefix
+                        * followed by ID_NAME-2 characters from id->name
                         */
                        char name_ui[MAX_ID_FULL_NAME];
                        BKE_id_full_name_ui_prefix_get(name_ui, id);
                         */
                        char name_ui[MAX_ID_FULL_NAME];
                        BKE_id_full_name_ui_prefix_get(name_ui, id);
index 80943792ce5af6c51ca0d6c6fb759d8e608ddefa..7400e922b30fcb5f76cb568870ac53169ffa928b 100644 (file)
@@ -37,7 +37,6 @@
 
 #include "BLT_translation.h"
 
 
 #include "BLT_translation.h"
 
-#include "BKE_library.h"
 #include "BKE_report.h"
 
 #include "MEM_guardedalloc.h"
 #include "BKE_report.h"
 
 #include "MEM_guardedalloc.h"
@@ -265,29 +264,22 @@ void ui_rna_collection_search_cb(const struct bContext *C, void *arg, const char
                                continue;
                }
 
                                continue;
                }
 
+               name = RNA_struct_name_get_alloc(&itemptr, NULL, 0, NULL); /* could use the string length here */
                iconid = 0;
                if (itemptr.type && RNA_struct_is_ID(itemptr.type)) {
                iconid = 0;
                if (itemptr.type && RNA_struct_is_ID(itemptr.type)) {
-                       name = MEM_malloc_arrayN(MAX_ID_FULL_NAME, sizeof(*name), __func__);
-                       BKE_id_full_name_ui_prefix_get(name, itemptr.data);
                        iconid = ui_id_icon_get(C, itemptr.data, false);
                }
                        iconid = ui_id_icon_get(C, itemptr.data, false);
                }
-               else {
-                       /* could use the string length here */
-                       name = RNA_struct_name_get_alloc(&itemptr, NULL, 0, NULL);
-               }
 
                if (name) {
                        if (skip_filter || BLI_strcasestr(name, str)) {
                                cis = MEM_callocN(sizeof(CollItemSearch), "CollectionItemSearch");
                                cis->data = itemptr.data;
 
                if (name) {
                        if (skip_filter || BLI_strcasestr(name, str)) {
                                cis = MEM_callocN(sizeof(CollItemSearch), "CollectionItemSearch");
                                cis->data = itemptr.data;
-                               cis->name = name;  /* Still ownership of that memory. */
+                               cis->name = MEM_dupallocN(name);
                                cis->index = i;
                                cis->iconid = iconid;
                                BLI_addtail(items_list, cis);
                        }
                                cis->index = i;
                                cis->iconid = iconid;
                                BLI_addtail(items_list, cis);
                        }
-                       else {
-                               MEM_freeN(name);
-                       }
+                       MEM_freeN(name);
                }
 
                i++;
                }
 
                i++;