[gimp] Bug 694585 - Export directly to remote ftp completes but reports failed
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 694585 - Export directly to remote ftp completes but reports failed
- Date: Sun, 24 Mar 2013 17:47:09 +0000 (UTC)
commit 7f31929bee7582c90868354b01560e129d3ff53f
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]