remove over zealous undo's on operators that don't need it.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 19 Aug 2011 20:25:25 +0000 (20:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 19 Aug 2011 20:25:25 +0000 (20:25 +0000)
source/blender/editors/render/render_shading.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_info/info_ops.c
source/blender/editors/space_sequencer/sequencer_edit.c

index cfed2750e18e14b3f99769f01d1e120008cb3548..fbdcf7ba9b301a92fbf83e95d27558a75f8ab8d7 100644 (file)
@@ -787,7 +787,7 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot)
        ot->poll= envmap_save_poll;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER; /* no undo since this doesnt modify the env-map */
        
        /* properties */
        //RNA_def_enum(ot->srna, "file_type", image_file_type_items, R_PNG, "File Type", "File type to save image as.");
@@ -875,8 +875,6 @@ static int copy_material_exec(bContext *C, wmOperator *UNUSED(op))
 
        copy_matcopybuf(ma);
 
-       WM_event_add_notifier(C, NC_MATERIAL, ma);
-
        return OPERATOR_FINISHED;
 }
 
@@ -891,7 +889,7 @@ void MATERIAL_OT_copy(wmOperatorType *ot)
        ot->exec= copy_material_exec;
 
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER; /* no undo needed since no changes are made to the material */
 }
 
 static int paste_material_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1015,8 +1013,6 @@ static int copy_mtex_exec(bContext *C, wmOperator *UNUSED(op))
 
        copy_mtex_copybuf(id);
 
-       WM_event_add_notifier(C, NC_TEXTURE, NULL);
-
        return OPERATOR_FINISHED;
 }
 
@@ -1039,7 +1035,7 @@ void TEXTURE_OT_slot_copy(wmOperatorType *ot)
        ot->poll= copy_mtex_poll;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER; /* no undo needed since no changes are made to the mtex */
 }
 
 static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
index ea8c7fc0cfa5227fda5b5c365270c09710c9ca01..6e0d19099632bbd11602d9f2e98e631e4d5c3059 100644 (file)
@@ -1331,7 +1331,7 @@ void IMAGE_OT_reload(wmOperatorType *ot)
        ot->exec= reload_exec;
 
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER; /* no undo, image buffer is not handled by undo */
 }
 
 /********************** new image operator *********************/
@@ -1989,7 +1989,7 @@ void IMAGE_OT_sample_line(wmOperatorType *ot)
        ot->cancel= WM_gesture_straightline_cancel;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= 0; /* no undo/register since this operates on the space */
        
        WM_operator_properties_gesture_straightline(ot, CURSOR_EDIT);
 }
index d58fb7b11f0557403cb6e6d6990de56508ebd481..e09565d38e933b581ab11eb2b50091480d3b434c 100644 (file)
@@ -273,7 +273,7 @@ void FILE_OT_report_missing_files(wmOperatorType *ot)
        ot->exec= report_missing_files_exec;
 
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= 0; /* only reports so no need to undo/register */
 }
 
 /********************* find missing files operator *********************/
index 531ecebba5e9fc58076ea913cf8b769d9c37770e..e876da41bd9c363b66f6cf952a23e7900b6bef56 100644 (file)
@@ -1202,7 +1202,7 @@ void SEQUENCER_OT_reload(struct wmOperatorType *ot)
        ot->poll= sequencer_edit_poll;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER; /* no undo, the data changed is stored outside 'main' */
 }
 
 /* reload operator */
@@ -2522,7 +2522,7 @@ void SEQUENCER_OT_copy(wmOperatorType *ot)
        ot->poll= sequencer_edit_poll;
 
        /* flags */
-       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag= OPTYPE_REGISTER;
 
        /* properties */
 }