From f36785c26c14e00d3385a2f6ca0890eb8030439c Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 16 Nov 2014 11:09:51 +0100 Subject: Cleanup: Replace `WM_operator_name_call` by `WM_operator_name_call_ptr` where possible. This avoids one lookup in optypes list... --- source/blender/editors/interface/interface.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/interface/interface.c') 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); } } -- cgit v1.2.3