Fix #20368: editing keymap item operator name would reset properties
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 14 Dec 2009 14:27:38 +0000 (14:27 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 14 Dec 2009 14:27:38 +0000 (14:27 +0000)
even if the name was not changed.

source/blender/makesrna/intern/rna_wm.c

index 5cf9c245b0546b61a2753e5449e436c1589879c1..0f6a14b78bdb852e39ff1d09fb94ebc67e533dd5 100644 (file)
@@ -586,9 +586,12 @@ static void rna_wmKeyMapItem_idname_set(PointerRNA *ptr, const char *value)
        char idname[OP_MAX_TYPENAME];
 
        WM_operator_bl_idname(idname, value);
-       BLI_strncpy(kmi->idname, idname, sizeof(kmi->idname));
 
-       WM_keymap_properties_reset(kmi);
+       if(strcmp(idname, kmi->idname) != 0) {
+               BLI_strncpy(kmi->idname, idname, sizeof(kmi->idname));
+
+               WM_keymap_properties_reset(kmi);
+       }
 }
 
 #else