diff options
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a64ec7fca2b..93f5a8e58d6 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2243,19 +2243,18 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str) void ui_but_default_set(bContext *C, const bool all, const bool use_afterfunc) { - const char *opstring = "UI_OT_reset_default_button"; + wmOperatorType *ot = WM_operatortype_find("UI_OT_reset_default_button", true); if (use_afterfunc) { PointerRNA *ptr; - wmOperatorType *ot = WM_operatortype_find(opstring, 0); ptr = ui_handle_afterfunc_add_operator(ot, WM_OP_EXEC_DEFAULT, true); RNA_boolean_set(ptr, "all", all); } else { PointerRNA ptr; - WM_operator_properties_create(&ptr, opstring); + WM_operator_properties_create_ptr(&ptr, ot); RNA_boolean_set(&ptr, "all", all); - WM_operator_name_call(C, opstring, WM_OP_EXEC_DEFAULT, &ptr); + WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &ptr); WM_operator_properties_free(&ptr); } } |