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



commit cc835e877d55922d248a890e94344f71e15d5cf3
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}".

 libgimp/gimp.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index 378f215169..1c28924655 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -2141,6 +2141,9 @@ gimp_loop (void)
 static void
 gimp_config (GPConfig *config)
 {
+  GFile *file;
+  gchar *path;
+
   _tile_width       = config->tile_width;
   _tile_height      = config->tile_height;
   _shm_ID           = config->shm_ID;
@@ -2163,6 +2166,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,
@@ -2171,6 +2177,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]