[gimp/soc-2011-seamless-clone2] Bug 694585 - Export directly to remote ftp completes but reports failed



commit 0b743d365ad6f62daced53de568a6ffe8538433a
Author: Michael Natterer <mitch gimp org>
Date:   Sun Mar 24 18:41:57 2013 +0100

    Bug 694585 - Export directly to remote ftp completes but reports failed
    
    Fix handling of save errors in file-uri in two ways:
    
    - don't try to check if saving to a directly mounted file succeeded,
      the mount (e.g. via FUSE) might allow writing, but not stat()ing.
      Instead, rely on the return value of gimp_file_save().
    
    - for non-mounted files, provide a separate error message for the case
      where the temporary file contains nothing, which is IMO useless
      paranoia, but the check was probably added for a reason, so keep
      it around.

 plug-ins/file-uri/uri.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/file-uri/uri.c b/plug-ins/file-uri/uri.c
index 539f463..049a30f 100644
--- a/plug-ins/file-uri/uri.c
+++ b/plug-ins/file-uri/uri.c
@@ -299,12 +299,25 @@ save_image (const gchar  *uri,
                       image_ID,
                       drawable_ID,
                       tmpname,
-                      tmpname) && valid_file (tmpname))
+                      tmpname))
     {
-      if (mapped || uri_backend_save_image (uri, tmpname, run_mode, error))
+      if (mapped)
         {
           status = GIMP_PDB_SUCCESS;
         }
+      else if (valid_file (tmpname))
+        {
+          if (uri_backend_save_image (uri, tmpname, run_mode, error))
+            {
+              status = GIMP_PDB_SUCCESS;
+            }
+        }
+      else
+        {
+          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+                       _("Failed to save to temporary file '%s'"),
+                       gimp_filename_to_utf8 (tmpname));
+        }
     }
   else
     {


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