Fix #28202: deactivating keymap items not saving properly.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 15 Aug 2011 10:03:17 +0000 (10:03 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 15 Aug 2011 10:03:17 +0000 (10:03 +0000)
source/blender/makesrna/intern/rna_wm.c
source/blender/windowmanager/intern/wm_keymap.c

index 307cf0e175add145871a4bbf490ec584328f7f9b..93adf808f8318102fd8b175792aedce4f3191a12 100644 (file)
@@ -1746,6 +1746,7 @@ static void rna_def_keyconfig(BlenderRNA *brna)
        RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", KMI_INACTIVE);
        RNA_def_property_ui_text(prop, "Active", "Activate or deactivate item");
        RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1);
+       RNA_def_property_update(prop, 0, "rna_KeyMapItem_update");
 
        prop= RNA_def_property(srna, "is_user_modified", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", KMI_USER_MODIFIED);
index 2dfe4d8ccdc57d9ace36a507bd85b3ec6f3d083e..6887aa4c7173e67cc0c56aa4cc5a8175422a0b83 100644 (file)
@@ -106,6 +106,9 @@ static int wm_keymap_item_equals_result(wmKeyMapItem *a, wmKeyMapItem *b)
             (a->ptr && b->ptr && IDP_EqualsProperties(a->ptr->data, b->ptr->data))))
                return 0;
        
+       if((a->flag & KMI_INACTIVE) != (b->flag & KMI_INACTIVE))
+               return 0;
+       
        return (a->propvalue == b->propvalue);
 }