diff --git a/app/actions/file-commands.c b/app/actions/file-commands.c index d7aa79a9dd..9d8a8173af 100644 --- a/app/actions/file-commands.c +++ b/app/actions/file-commands.c @@ -299,13 +299,14 @@ file_save_cmd_callback (GtkAction *action, case GIMP_SAVE_MODE_EXPORT: case GIMP_SAVE_MODE_OVERWRITE: { - const gchar *uri = NULL; - GimpPlugInProcedure *export_proc; - gboolean overwrite = FALSE; + const gchar *uri = NULL; + GimpPlugInProcedure *export_proc = NULL; + gboolean overwrite = FALSE; if (save_mode == GIMP_SAVE_MODE_EXPORT) { - uri = gimp_image_get_exported_uri (image); + uri = gimp_image_get_exported_uri (image); + export_proc = gimp_image_get_export_proc (image); if (! uri) { @@ -323,7 +324,7 @@ file_save_cmd_callback (GtkAction *action, overwrite = TRUE; } - if (uri) + if (uri && ! export_proc) { export_proc = file_procedure_find (image->gimp->plug_in_manager->export_procs, diff --git a/app/core/gimpimage-private.h b/app/core/gimpimage-private.h index a4ae2f1855..215bb1814f 100644 --- a/app/core/gimpimage-private.h +++ b/app/core/gimpimage-private.h @@ -38,6 +38,7 @@ struct _GimpImagePrivate GimpPlugInProcedure *load_proc; /* procedure used for loading */ GimpPlugInProcedure *save_proc; /* last save procedure used */ + GimpPlugInProcedure *export_proc; /* last export procedure used */ gchar *display_name; /* display basename */ gchar *display_path; /* display full path */ diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 1057117690..aa22707a97 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -2206,6 +2206,23 @@ gimp_image_get_save_proc (const GimpImage *image) return GIMP_IMAGE_GET_PRIVATE (image)->save_proc; } +void +gimp_image_set_export_proc (GimpImage *image, + GimpPlugInProcedure *proc) +{ + g_return_if_fail (GIMP_IS_IMAGE (image)); + + GIMP_IMAGE_GET_PRIVATE (image)->export_proc = proc; +} + +GimpPlugInProcedure * +gimp_image_get_export_proc (const GimpImage *image) +{ + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); + + return GIMP_IMAGE_GET_PRIVATE (image)->export_proc; +} + void gimp_image_set_resolution (GimpImage *image, gdouble xresolution, diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 6a3cfeb0f6..bc0900fd0f 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -163,6 +163,9 @@ void gimp_image_set_save_proc (GimpImage *image, GimpPlugInProcedure * gimp_image_get_save_proc (const GimpImage *image); void gimp_image_saved (GimpImage *image, const gchar *uri); +void gimp_image_set_export_proc (GimpImage *image, + GimpPlugInProcedure *proc); +GimpPlugInProcedure * gimp_image_get_export_proc (const GimpImage *image); void gimp_image_exported (GimpImage *image, const gchar *uri); diff --git a/app/file/file-save.c b/app/file/file-save.c index 19d02f9f59..6006ec21dd 100644 --- a/app/file/file-save.c +++ b/app/file/file-save.c @@ -198,6 +198,7 @@ file_save (Gimp *gimp, * of a GimpImage is the last-save URI */ gimp_image_set_exported_uri (image, uri); + gimp_image_set_export_proc (image, file_proc); /* An image can not be considered both exported and imported * at the same time, so stop consider it as imported now