app/core/gimpimage.[ch] renamed gimage->freeze_count to

2004-03-15  Simon Budig  <simon@gimp.org>

	* app/core/gimpimage.[ch]
	* app/core/gimpimage-undo.c: renamed gimage->freeze_count
	to gimage->undo_freeze_count (more explicit).

	* app/file/file-open.c: Ensure that the undo system is enabled
	after loading an image (to protect against broken loaders).
This commit is contained in:
Simon Budig 2004-03-14 23:19:49 +00:00 committed by Simon Budig
parent 63bb032f70
commit dfd41249fe
5 changed files with 22 additions and 9 deletions

View File

@ -1,3 +1,12 @@
2004-03-15 Simon Budig <simon@gimp.org>
* app/core/gimpimage.[ch]
* app/core/gimpimage-undo.c: renamed gimage->freeze_count
to gimage->undo_freeze_count (more explicit).
* app/file/file-open.c: Ensure that the undo system is enabled
after loading an image (to protect against broken loaders).
2004-03-14 Sven Neumann <sven@gimp.org>
* app/tools/gimpcolorpickertool.c

View File

@ -121,7 +121,7 @@ gimp_image_undo_group_start (GimpImage *gimage,
/* Notify listeners that the image will be modified */
gimp_image_undo_start (gimage);
if (gimage->freeze_count > 0)
if (gimage->undo_freeze_count > 0)
return FALSE;
gimage->group_count++;
@ -160,7 +160,7 @@ gimp_image_undo_group_end (GimpImage *gimage)
{
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
if (gimage->freeze_count > 0)
if (gimage->undo_freeze_count > 0)
return FALSE;
g_return_val_if_fail (gimage->group_count > 0, FALSE);
@ -226,7 +226,7 @@ gimp_image_undo_push_item (GimpImage *gimage,
if (dirties_image)
gimp_image_dirty (gimage);
if (gimage->freeze_count > 0)
if (gimage->undo_freeze_count > 0)
return NULL;
/* nuke the redo stack */

View File

@ -473,7 +473,7 @@ gimp_image_init (GimpImage *gimage)
gimage->num_cols = 0;
gimage->dirty = 1;
gimage->freeze_count = 0;
gimage->undo_freeze_count = 0;
gimage->instance_count = 0;
gimage->disp_count = 0;
@ -1520,7 +1520,7 @@ gimp_image_undo_is_enabled (const GimpImage *gimage)
{
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
return (gimage->freeze_count == 0);
return (gimage->undo_freeze_count == 0);
}
gboolean
@ -1547,7 +1547,7 @@ gimp_image_undo_freeze (GimpImage *gimage)
{
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
gimage->freeze_count++;
gimage->undo_freeze_count++;
gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_FREEZE, NULL);
@ -1558,9 +1558,9 @@ gboolean
gimp_image_undo_thaw (GimpImage *gimage)
{
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (gimage->freeze_count > 0, FALSE);
g_return_val_if_fail (gimage->undo_freeze_count > 0, FALSE);
gimage->freeze_count--;
gimage->undo_freeze_count--;
gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_THAW, NULL);

View File

@ -114,7 +114,7 @@ struct _GimpImage
gint num_cols; /* number of cols--for indexed */
gint dirty; /* dirty flag -- # of ops */
gint freeze_count; /* counts the _freeze's */
gint undo_freeze_count; /* counts the _freeze's */
gint instance_count; /* number of instances */
gint disp_count; /* number of displays */

View File

@ -207,6 +207,10 @@ file_open_with_proc_and_display (Gimp *gimp,
/* 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);