[gimp] app: also check for errors on closing the file in xcf_save_invoker()



commit a4ff0b17c8a75a75d85963f25b8318dbb2a64aea
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jul 13 15:09:54 2014 +0200

    app: also check for errors on closing the file in xcf_save_invoker()
    
    and improve the error message.

 app/xcf/xcf.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c
index e008e0a..c675a86 100644
--- a/app/xcf/xcf.c
+++ b/app/xcf/xcf.c
@@ -397,7 +397,20 @@ xcf_save_invoker (GimpProcedure         *procedure,
 
       xcf_save_choose_format (&info, image);
 
-      success = xcf_save_image (&info, image, error);
+      success = xcf_save_image (&info, image, &my_error);
+
+      if (success)
+        {
+          if (progress)
+            gimp_progress_set_text (progress, _("Closing '%s'"), filename);
+
+          success = g_output_stream_close (info.output, NULL, &my_error);
+        }
+
+      if (! success)
+        g_propagate_prefixed_error (error, my_error,
+                                    _("Error writing '%s': "),
+                                    filename);
 
       g_object_unref (info.output);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]