Commit bbc73e63 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

removed the undo clearing/sanitizing code...

2004-03-22  Michael Natterer  <mitch@gimp.org>

	* app/file/file-open.c (file_open_with_proc_and_display): removed
	the undo clearing/sanitizing code...

	(file_open_image): ...and added it here so *all* newly opened
	images start with a clean and sane undo state.

	* app/gui/file-commands.c (file_revert_confirm_callback): removed
	(incomplete) undo sanitizing here too.
parent 58df261e
2004-03-22 Michael Natterer <mitch@gimp.org>
* app/file/file-open.c (file_open_with_proc_and_display): removed
the undo clearing/sanitizing code...
(file_open_image): ...and added it here so *all* newly opened
images start with a clean and sane undo state.
* app/gui/file-commands.c (file_revert_confirm_callback): removed
(incomplete) undo sanitizing here too.
2004-03-22 Sven Neumann <sven@gimp.org>
 
* tools/gimp-remote.c: use putenv(); setenv() isn't available
......@@ -33,7 +33,6 @@
#include "core/gimpcontext.h"
#include "core/gimplist.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "core/gimptemplate.h"
#include "file/file-open.h"
......@@ -441,9 +440,7 @@ file_revert_confirm_callback (GtkWidget *widget,
contexts = g_list_prepend (contexts, list->data);
}
gimp_image_undo_free (new_gimage);
gimp_displays_reconnect (gimp, old_gimage, new_gimage);
gimp_image_clean_all (new_gimage);
gimp_image_flush (new_gimage);
/* set the new_gimage on the remembered contexts (in reverse
......
......@@ -142,9 +142,17 @@ file_open_image (Gimp *gimp,
{
if (gimage_id != -1)
{
GimpImage *gimage;
GimpImage *gimage = gimp_image_get_by_ID (gimp, gimage_id);
gimage = gimp_image_get_by_ID (gimp, gimage_id);
/* clear all undo steps */
gimp_image_undo_free (gimage);
/* make sure that undo is enabled */
while (gimage->undo_freeze_count)
gimp_image_undo_thaw (gimage);
/* set the image to clean */
gimp_image_clean_all (gimage);
gimp_image_invalidate_layer_previews (gimage);
gimp_image_invalidate_channel_previews (gimage);
......@@ -204,20 +212,8 @@ file_open_with_proc_and_display (Gimp *gimp,
GimpDocumentList *documents;
GimpImagefile *imagefile;
/* clear all undo steps */
gimp_image_undo_free (gimage);
/* make sure that undo is enabled */
while (gimage->undo_freeze_count)
gimp_image_undo_thaw (gimage);
/* set the image to clean */
gimp_image_clean_all (gimage);
gimp_create_display (gimage->gimp, gimage, 1.0);
g_object_unref (gimage);
documents = GIMP_DOCUMENT_LIST (gimp->documents);
imagefile = gimp_document_list_add_uri (documents, uri);
......@@ -229,6 +225,9 @@ file_open_with_proc_and_display (Gimp *gimp,
/* save a thumbnail of every opened image */
gimp_imagefile_save_thumbnail (imagefile, gimage);
}
/* the display owns the image now */
g_object_unref (gimage);
}
return gimage;
......
......@@ -33,7 +33,6 @@
#include "core/gimpcontext.h"
#include "core/gimplist.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "core/gimptemplate.h"
#include "file/file-open.h"
......@@ -441,9 +440,7 @@ file_revert_confirm_callback (GtkWidget *widget,
contexts = g_list_prepend (contexts, list->data);
}
gimp_image_undo_free (new_gimage);
gimp_displays_reconnect (gimp, old_gimage, new_gimage);
gimp_image_clean_all (new_gimage);
gimp_image_flush (new_gimage);
/* set the new_gimage on the remembered contexts (in reverse
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment