[gimp] app: fix backup creation on crash.



commit 949d7eee3bbc17a48f4e3b8c6b095a5d0b3f8718
Author: Jehan <jehan girinstud io>
Date:   Thu Jul 30 14:17:02 2020 +0200

    app: fix backup creation on crash.
    
    The call to "gimp-xcf-save" was not updated to the new API using a
    drawable array and a GFile.
    Also for the drawable array, do not actually create it as anyway this is
    a dummy argument (so far XCF saving does not even look at this argument
    and just re-check the selected drawables).

 app/errors.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/app/errors.c b/app/errors.c
index ec1e88cb7f..ad819d35ea 100644
--- a/app/errors.c
+++ b/app/errors.c
@@ -474,13 +474,10 @@ gimp_eek (const gchar *reason,
       for (; iter && i < 1000; iter = iter->next)
         {
           GimpImage *image = iter->data;
-          GimpItem  *item;
 
           if (! gimp_image_is_dirty (image))
             continue;
 
-          item = GIMP_ITEM (gimp_image_get_active_drawable (image));
-
           /* This is a trick because we want to avoid any memory
            * allocation when the process is abnormally terminated.
            * We just assume that you'll never have more than 1000 images
@@ -495,11 +492,11 @@ gimp_eek (const gchar *reason,
                                               gimp_get_user_context (the_errors_gimp),
                                               NULL, NULL,
                                               "gimp-xcf-save",
-                                              GIMP_TYPE_RUN_MODE, GIMP_RUN_NONINTERACTIVE,
-                                              GIMP_TYPE_IMAGE,    image,
-                                              GIMP_TYPE_DRAWABLE, item,
-                                              G_TYPE_STRING,      backup_path,
-                                              G_TYPE_STRING,      backup_path,
+                                              GIMP_TYPE_RUN_MODE,     GIMP_RUN_NONINTERACTIVE,
+                                              GIMP_TYPE_IMAGE,        image,
+                                              G_TYPE_INT,             0,
+                                              GIMP_TYPE_OBJECT_ARRAY, NULL,
+                                              G_TYPE_FILE,            g_file_new_for_path (backup_path),
                                               G_TYPE_NONE);
           i++;
         }


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