From 43c341c055b68ade166329323b07678889c15dfb Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 9 Apr 2003 09:52:01 +0000 Subject: [PATCH] added "gboolean set_image_clean" and call gimp_image_clean_all() only if 2003-04-09 Michael Natterer * app/file/file-save.[ch] (file_save_as): added "gboolean set_image_clean" and call gimp_image_clean_all() only if it was passed as TRUE. (file_save): pass TRUE. * app/gui/file-save-dialog.c: pass TRUE from the "Save as" and FALSE from the "Save a Copy" dialog (bug #109464). --- ChangeLog | 10 ++++++++++ app/dialogs/file-save-dialog.c | 16 ++++++++++++---- app/file/file-save.c | 11 ++++++++--- app/file/file-save.h | 1 + app/gui/file-save-dialog.c | 16 ++++++++++++---- 5 files changed, 43 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ddc12decf..ca000f8f8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2003-04-09 Michael Natterer + + * app/file/file-save.[ch] (file_save_as): added "gboolean + set_image_clean" and call gimp_image_clean_all() only if it + was passed as TRUE. + (file_save): pass TRUE. + + * app/gui/file-save-dialog.c: pass TRUE from the "Save as" and + FALSE from the "Save a Copy" dialog (bug #109464). + 2003-04-09 Michael Natterer * app/core/gimpimage.c (gimp_image_remove_channel): say diff --git a/app/dialogs/file-save-dialog.c b/app/dialogs/file-save-dialog.c index 3e4182c5aa..17e074124b 100644 --- a/app/dialogs/file-save-dialog.c +++ b/app/dialogs/file-save-dialog.c @@ -70,7 +70,8 @@ static void file_save_dialog_save_image (GtkWidget *save_dialog, const gchar *uri, const gchar *raw_filename, PlugInProcDef *save_proc, - gboolean set_uri_and_proc); + gboolean set_uri_and_proc, + gboolean set_image_clean); static GtkWidget *filesave = NULL; @@ -78,6 +79,7 @@ static GtkWidget *filesave = NULL; static PlugInProcDef *save_file_proc = NULL; static GimpImage *the_gimage = NULL; static gboolean set_uri_and_proc = TRUE; +static gboolean set_image_clean = TRUE; /* public functions */ @@ -106,6 +108,7 @@ file_save_dialog_show (GimpImage *gimage, the_gimage = gimage; set_uri_and_proc = TRUE; + set_image_clean = TRUE; if (! filesave) filesave = file_save_dialog_create (gimage->gimp, menu_factory); @@ -153,6 +156,7 @@ file_save_a_copy_dialog_show (GimpImage *gimage, the_gimage = gimage; set_uri_and_proc = FALSE; + set_image_clean = FALSE; uri = gimp_object_get_name (GIMP_OBJECT (gimage)); @@ -292,7 +296,8 @@ file_save_ok_callback (GtkWidget *widget, uri, raw_filename, save_file_proc, - set_uri_and_proc); + set_uri_and_proc, + set_image_clean); gtk_widget_set_sensitive (GTK_WIDGET (fs), TRUE); } @@ -366,7 +371,8 @@ file_save_overwrite_callback (GtkWidget *widget, overwrite_data->uri, overwrite_data->raw_filename, save_file_proc, - set_uri_and_proc); + set_uri_and_proc, + set_image_clean); } gtk_widget_set_sensitive (overwrite_data->save_dialog, TRUE); @@ -382,7 +388,8 @@ file_save_dialog_save_image (GtkWidget *save_dialog, const gchar *uri, const gchar *raw_filename, PlugInProcDef *save_proc, - gboolean set_uri_and_proc) + gboolean set_uri_and_proc, + gboolean set_image_clean) { GimpPDBStatusType status; GError *error = NULL; @@ -393,6 +400,7 @@ file_save_dialog_save_image (GtkWidget *save_dialog, save_proc, GIMP_RUN_INTERACTIVE, set_uri_and_proc, + set_image_clean, &error); if (status != GIMP_PDB_SUCCESS && diff --git a/app/file/file-save.c b/app/file/file-save.c index 8f50929b96..fcc398aadc 100644 --- a/app/file/file-save.c +++ b/app/file/file-save.c @@ -79,7 +79,8 @@ file_save (GimpImage *gimage, file_proc = gimp_image_get_save_proc (gimage); - return file_save_as (gimage, uri, uri, file_proc, run_mode, FALSE, error); + return file_save_as (gimage, uri, uri, file_proc, run_mode, + FALSE, TRUE, error); } GimpPDBStatusType @@ -89,6 +90,7 @@ file_save_as (GimpImage *gimage, PlugInProcDef *file_proc, GimpRunMode run_mode, gboolean set_uri_and_proc, + gboolean set_image_clean, GError **error) { ProcRecord *proc; @@ -170,8 +172,11 @@ file_save_as (GimpImage *gimage, GimpDocumentList *documents; GimpImagefile *imagefile; - /* set this image to clean */ - gimp_image_clean_all (gimage); + if (set_image_clean) + { + /* set this image to clean */ + gimp_image_clean_all (gimage); + } documents = GIMP_DOCUMENT_LIST (gimage->gimp->documents); imagefile = gimp_document_list_add_uri (documents, uri); diff --git a/app/file/file-save.h b/app/file/file-save.h index a31b945262..9507a2e2ff 100644 --- a/app/file/file-save.h +++ b/app/file/file-save.h @@ -29,6 +29,7 @@ GimpPDBStatusType file_save_as (GimpImage *gimage, PlugInProcDef *file_proc, GimpRunMode run_mode, gboolean set_uri_and_proc, + gboolean set_image_clean, GError **error); diff --git a/app/gui/file-save-dialog.c b/app/gui/file-save-dialog.c index 3e4182c5aa..17e074124b 100644 --- a/app/gui/file-save-dialog.c +++ b/app/gui/file-save-dialog.c @@ -70,7 +70,8 @@ static void file_save_dialog_save_image (GtkWidget *save_dialog, const gchar *uri, const gchar *raw_filename, PlugInProcDef *save_proc, - gboolean set_uri_and_proc); + gboolean set_uri_and_proc, + gboolean set_image_clean); static GtkWidget *filesave = NULL; @@ -78,6 +79,7 @@ static GtkWidget *filesave = NULL; static PlugInProcDef *save_file_proc = NULL; static GimpImage *the_gimage = NULL; static gboolean set_uri_and_proc = TRUE; +static gboolean set_image_clean = TRUE; /* public functions */ @@ -106,6 +108,7 @@ file_save_dialog_show (GimpImage *gimage, the_gimage = gimage; set_uri_and_proc = TRUE; + set_image_clean = TRUE; if (! filesave) filesave = file_save_dialog_create (gimage->gimp, menu_factory); @@ -153,6 +156,7 @@ file_save_a_copy_dialog_show (GimpImage *gimage, the_gimage = gimage; set_uri_and_proc = FALSE; + set_image_clean = FALSE; uri = gimp_object_get_name (GIMP_OBJECT (gimage)); @@ -292,7 +296,8 @@ file_save_ok_callback (GtkWidget *widget, uri, raw_filename, save_file_proc, - set_uri_and_proc); + set_uri_and_proc, + set_image_clean); gtk_widget_set_sensitive (GTK_WIDGET (fs), TRUE); } @@ -366,7 +371,8 @@ file_save_overwrite_callback (GtkWidget *widget, overwrite_data->uri, overwrite_data->raw_filename, save_file_proc, - set_uri_and_proc); + set_uri_and_proc, + set_image_clean); } gtk_widget_set_sensitive (overwrite_data->save_dialog, TRUE); @@ -382,7 +388,8 @@ file_save_dialog_save_image (GtkWidget *save_dialog, const gchar *uri, const gchar *raw_filename, PlugInProcDef *save_proc, - gboolean set_uri_and_proc) + gboolean set_uri_and_proc, + gboolean set_image_clean) { GimpPDBStatusType status; GError *error = NULL; @@ -393,6 +400,7 @@ file_save_dialog_save_image (GtkWidget *save_dialog, save_proc, GIMP_RUN_INTERACTIVE, set_uri_and_proc, + set_image_clean, &error); if (status != GIMP_PDB_SUCCESS &&