diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-09-29 09:20:56 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-09-29 09:28:02 +0300 |
commit | ba90d2efa58fe23a87f98e014bcc02ea951a6a49 (patch) | |
tree | b1c3c245493b5e7ca358108801530926031f60f4 /source/blender/windowmanager/intern/wm_operator_type.c | |
parent | 44d042094e21b519b38a3d78761b64bb5ceeb350 (diff) |
Fix T58683: Reload Scripts breaks toolbar button formatting.
Assuming it's actually necessary to do this check very efficiently,
replace the hack based on caching a pointer, with a different one
that caches the string comparison result in the operator object.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operator_type.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operator_type.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operator_type.c b/source/blender/windowmanager/intern/wm_operator_type.c index e3fe8892515..394efc856e3 100644 --- a/source/blender/windowmanager/intern/wm_operator_type.c +++ b/source/blender/windowmanager/intern/wm_operator_type.c @@ -20,6 +20,8 @@ * Operator Registry. */ +#include <string.h> + #include "MEM_guardedalloc.h" #include "CLG_log.h" @@ -127,6 +129,9 @@ static void wm_operatortype_append__end(wmOperatorType *ot) ot->srna, ot->name, ot->description ? ot->description : UNDOCUMENTED_OPERATOR_TIP); RNA_def_struct_identifier(&BLENDER_RNA, ot->srna, ot->idname); + /* A hack for efficiently detecting buttons with this specific operator. */ + ot->is_tool_button = STREQ(ot->idname, "WM_OT_tool_set_by_id"); + BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot); } |