[gimp/gimp-2-10] libgimp: need to expand config->swap_path in gimp_config()



commit f6350e1b5a79849bb2019463de6bbff24ee2f491
Author: Michael Natterer <mitch gimp org>
Date:   Tue Dec 4 19:41:06 2018 +0100

    libgimp: need to expand config->swap_path in gimp_config()
    
    or the file system will be polluted with folders called
    "${gimp_cache_path}".
    
    (cherry picked from commit cc835e877d55922d248a890e94344f71e15d5cf3)

 libgimp/gimp.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index 85acc60636..b0323c62ec 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -2294,6 +2294,9 @@ gimp_loop (void)
 static void
 gimp_config (GPConfig *config)
 {
+  GFile *file;
+  gchar *path;
+
   if (config->version < GIMP_PROTOCOL_VERSION)
     {
       g_message ("Could not execute plug-in \"%s\"\n(%s)\n"
@@ -2337,6 +2340,9 @@ gimp_config (GPConfig *config)
 
   gimp_cpu_accel_set_use (config->use_cpu_accel);
 
+  file = gimp_file_new_for_config_path (config->swap_path, NULL);
+  path = g_file_get_path (file);
+
   g_object_set (gegl_config (),
                 "tile-cache-size",     config->tile_cache_size,
                 "swap",                config->swap_path,
@@ -2345,6 +2351,9 @@ gimp_config (GPConfig *config)
                 "application-license", "GPL3",
                 NULL);
 
+  g_free (path);
+  g_object_unref (file);
+
   if (_shm_ID != -1)
     {
 #if defined(USE_SYSV_SHM)


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