Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-11-16 13:09:51 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2014-11-16 13:11:05 +0300
commitf36785c26c14e00d3385a2f6ca0890eb8030439c (patch)
tree0d1548abb0fc75b2b4c99f8c1ddb9533540e6ab9 /source/blender/editors/interface/interface.c
parent10813996e80cddafcd2af3d71eaee3ef4fbe796e (diff)
Cleanup: Replace `WM_operator_name_call` by `WM_operator_name_call_ptr` where possible.
This avoids one lookup in optypes list...
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r--source/blender/editors/interface/interface.c7
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);
}
}