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:
authorCampbell Barton <ideasman42@gmail.com>2011-09-02 12:01:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-02 12:01:01 +0400
commit1d9ddcd319908f6442b02623f7782413ecefa40a (patch)
tree7eec514c6160b538f764253b4849f39d49e1a71d /source/blender/windowmanager
parente6ff3df5b980ebda24f14d0d211bb0739aa64f12 (diff)
tweak to WM_operatortype_find to perform better when called with empty strings (as the keymap editor does a lot)
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index c053022681b..0e0203543a4 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -108,21 +108,28 @@ static GHash *global_ops_hash= NULL;
wmOperatorType *WM_operatortype_find(const char *idname, int quiet)
{
- wmOperatorType *ot;
-
- char idname_bl[OP_MAX_TYPENAME]; // XXX, needed to support python style names without the _OT_ syntax
- WM_operator_bl_idname(idname_bl, idname);
+ if(idname[0]) {
+ wmOperatorType *ot;
+
+ /* needed to support python style names without the _OT_ syntax */
+ char idname_bl[OP_MAX_TYPENAME];
+ WM_operator_bl_idname(idname_bl, idname);
- if (idname_bl[0]) {
ot= BLI_ghash_lookup(global_ops_hash, idname_bl);
if(ot) {
return ot;
}
+
+ if(!quiet) {
+ printf("search for unknown operator '%s', '%s'\n", idname_bl, idname);
+ }
}
-
- if(!quiet)
- printf("search for unknown operator %s, %s\n", idname_bl, idname);
-
+ else {
+ if(!quiet) {
+ printf("search for empty operator\n");
+ }
+ }
+
return NULL;
}