[gimp] app: make MyPaint brushes path relative on Win32 and macOS.



commit 4698529dbe9bf6ffdf44da21ce65fcec5dee6c41
Author: Jehan <jehan girinstud io>
Date:   Thu Mar 29 22:22:51 2018 +0200

    app: make MyPaint brushes path relative on Win32 and macOS.
    
    Otherwise the brushes won't be found when bundling on macOS or with the
    Windows installer. Build-time path from configuration is still used on
    other platforms.

 app/config/gimpcoreconfig.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/app/config/gimpcoreconfig.c b/app/config/gimpcoreconfig.c
index bd2521e..eb7978a 100644
--- a/app/config/gimpcoreconfig.c
+++ b/app/config/gimpcoreconfig.c
@@ -151,6 +151,7 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   gchar        *path;
+  gchar        *mypaint_brushes;
   GimpRGB       red          = { 1.0, 0, 0, 0.5 };
   guint64       undo_size;
 
@@ -261,10 +262,20 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
                          GIMP_CONFIG_PARAM_RESTART);
   g_free (path);
 
+#if defined G_OS_WIN32 || defined PLATFORM_OSX
+  mypaint_brushes = g_build_filename ("${gimp_installation_dir}",
+                                      "share", "mypaint-data",
+                                      "1.0", "brushes", NULL);
+#else
+  mypaint_brushes = g_strdup (MYPAINT_BRUSHES_DIR);
+#endif
+
   path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
-                       MYPAINT_BRUSHES_DIR,
+                       mypaint_brushes,
                        "~/.mypaint/brushes",
                        NULL);
+  g_free (mypaint_brushes);
+
   GIMP_CONFIG_PROP_PATH (object_class, PROP_MYPAINT_BRUSH_PATH,
                          "mypaint-brush-path",
                          "MyPaint brush path",


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