Merging r39251 through r39311 from trunk into soc-2011-tomato
[blender-staging.git] / source / blender / editors / interface / interface_templates.c
index c4fd67cf06fc08e0cb3f62e76e7a02263d91278c..1613b073ed65dee88430b9c58853207083ed8e5a 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
+#include "BLI_ghash.h"
 
 #include "BKE_animsys.h"
 #include "BKE_colortools.h"
@@ -2110,7 +2111,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
        }
        else if(itemptr->type == &RNA_ShapeKey) {
                Object *ob= (Object*)activeptr->data;
-               Key *key= (Key*)itemptr->data;
+               Key *key= (Key*)itemptr->id.data;
 
                split= uiLayoutSplit(sub, 0.75f, 0);
 
@@ -2322,10 +2323,11 @@ static void operator_call_cb(bContext *C, void *UNUSED(arg1), void *arg2)
 
 static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
 {
-       wmOperatorType *ot = WM_operatortype_first();
-       
-       for(; ot; ot= ot->next) {
-               
+       GHashIterator *iter= WM_operatortype_iter();
+
+       for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+               wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
+
                if(BLI_strcasestr(ot->name, str)) {
                        if(WM_operator_poll((bContext*)C, ot)) {
                                char name[256];
@@ -2345,6 +2347,7 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char
                        }
                }
        }
+       BLI_ghashIterator_free(iter);
 }
 
 void uiTemplateOperatorSearch(uiLayout *layout)