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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 93adf808f83..4c07a89a42f 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -680,20 +680,14 @@ static void rna_wmKeyMapItem_name_get(PointerRNA *ptr, char *value)
{
wmKeyMapItem *kmi= ptr->data;
wmOperatorType *ot= WM_operatortype_find(kmi->idname, 1);
-
- if (ot)
- strcpy(value, ot->name);
+ strcpy(value, ot ? ot->name : kmi->idname);
}
static int rna_wmKeyMapItem_name_length(PointerRNA *ptr)
{
wmKeyMapItem *kmi= ptr->data;
wmOperatorType *ot= WM_operatortype_find(kmi->idname, 1);
-
- if (ot)
- return strlen(ot->name);
- else
- return 0;
+ return strlen(ot ? ot->name : kmi->idname);
}
static int rna_KeyMapItem_userdefined_get(PointerRNA *ptr)
@@ -1652,7 +1646,9 @@ static void rna_def_keyconfig(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, "rna_wmKeyMapItem_idname_get", "rna_wmKeyMapItem_idname_length", "rna_wmKeyMapItem_idname_set");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
-
+
+ /* this is infact the operator name, but if the operator can't be found we
+ * fallback on the operator ID */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Name", "Name of operator to call on input event");