[gimp] Bug 792657 - A useless error message when cancelling opening a .svgz.



commit c548d5d342e4846c0409b74bdfc7920782455690
Author: Jehan <jehan girinstud io>
Date:   Fri Jan 19 14:20:40 2018 +0100

    Bug 792657 - A useless error message when cancelling opening a .svgz.
    
    Use the new gimp_get_pdb_status() to forward the error returned by
    gimp_file_load(). Previous code was always returning
    GIMP_PDB_EXECUTION_ERROR when the file load was failing, but this was
    not granular enough. In particular when the file load is actually
    interactively cancelled through Esc or the "Cancel" button, we don't
    want to display an error message on screen. Therefore we forward the
    actual error raised by the underlining plug-in.

 plug-ins/common/file-compressor.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/common/file-compressor.c b/plug-ins/common/file-compressor.c
index 74afe2f..8fc7409 100644
--- a/plug-ins/common/file-compressor.c
+++ b/plug-ins/common/file-compressor.c
@@ -508,7 +508,10 @@ load_image (const Compressor   *compressor,
     }
   else
     {
-      *status = GIMP_PDB_EXECUTION_ERROR;
+      /* Forward the return status of the underlining plug-in for the
+       * given format.
+       */
+      *status = gimp_get_pdb_status ();
 
       g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                    "%s", gimp_get_pdb_error ());


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