[gimp] libgimpbase, libgimp, app: inherit swap-compression in plug-ins



commit 5cc289b6429d86e179a26b6b6d2b2a896550af7f
Author: Ell <ell_se yahoo com>
Date:   Sun Sep 22 17:48:16 2019 +0300

    libgimpbase, libgimp, app: inherit swap-compression in plug-ins
    
    Pass the swap-compression option set in the preferences down to
    plug-ins, so that they use the same swap-compression algorithm as
    the main app.

 app/plug-in/gimppluginmanager-call.c | 1 +
 libgimp/gimp.c                       | 1 +
 libgimpbase/gimpprotocol.c           | 8 ++++++++
 libgimpbase/gimpprotocol.h           | 3 ++-
 4 files changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c
index d89c1d70a2..7b0bde381d 100644
--- a/app/plug-in/gimppluginmanager-call.c
+++ b/app/plug-in/gimppluginmanager-call.c
@@ -227,6 +227,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager   *manager,
                                   NULL;
       config.tile_cache_size  = gegl_config->tile_cache_size;
       config.swap_path        = gegl_config->swap_path;
+      config.swap_compression = gegl_config->swap_compression;
       config.num_processors   = gegl_config->num_processors;
 
       proc_run.name     = (gchar *) gimp_object_get_name (procedure);
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index e193fb1ef0..1da01f3c8c 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -1131,6 +1131,7 @@ _gimp_config (GPConfig *config)
   g_object_set (gegl_config (),
                 "tile-cache-size",     config->tile_cache_size,
                 "swap",                path,
+                "swap-compression",    config->swap_compression,
                 "threads",             (gint) config->num_processors,
                 "use-opencl",          config->use_opencl,
                 "application-license", "GPL3",
diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c
index 91b5e04f9e..827f95cf81 100644
--- a/libgimpbase/gimpprotocol.c
+++ b/libgimpbase/gimpprotocol.c
@@ -550,6 +550,9 @@ _gp_config_read (GIOChannel      *channel,
   if (! _gimp_wire_read_string (channel,
                                 &config->swap_path, 1, user_data))
     goto cleanup;
+  if (! _gimp_wire_read_string (channel,
+                                &config->swap_compression, 1, user_data))
+    goto cleanup;
   if (! _gimp_wire_read_int32 (channel,
                                (guint32 *) &config->num_processors, 1,
                                user_data))
@@ -564,6 +567,7 @@ _gp_config_read (GIOChannel      *channel,
   g_free (config->display_name);
   g_free (config->icon_theme_dir);
   g_free (config->swap_path);
+  g_free (config->swap_compression);
   g_slice_free (GPConfig, config);
 }
 
@@ -650,6 +654,9 @@ _gp_config_write (GIOChannel      *channel,
   if (! _gimp_wire_write_string (channel,
                                  &config->swap_path, 1, user_data))
     return;
+  if (! _gimp_wire_write_string (channel,
+                                 &config->swap_compression, 1, user_data))
+    return;
   if (! _gimp_wire_write_int32 (channel,
                                 (const guint32 *) &config->num_processors, 1,
                                 user_data))
@@ -668,6 +675,7 @@ _gp_config_destroy (GimpWireMessage *msg)
       g_free (config->display_name);
       g_free (config->icon_theme_dir);
       g_free (config->swap_path);
+      g_free (config->swap_compression);
       g_slice_free (GPConfig, config);
     }
 }
diff --git a/libgimpbase/gimpprotocol.h b/libgimpbase/gimpprotocol.h
index a878b64193..c01a58ffad 100644
--- a/libgimpbase/gimpprotocol.h
+++ b/libgimpbase/gimpprotocol.h
@@ -26,7 +26,7 @@ G_BEGIN_DECLS
 
 /* Increment every time the protocol changes
  */
-#define GIMP_PROTOCOL_VERSION  0x010C
+#define GIMP_PROTOCOL_VERSION  0x010D
 
 
 enum
@@ -122,6 +122,7 @@ struct _GPConfig
   gchar   *icon_theme_dir;
   guint64  tile_cache_size;
   gchar   *swap_path;
+  gchar   *swap_compression;
   gint32   num_processors;
 };
 


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