[gimp] app: identifier of MyPaint brush GimpData using ${mypaint_brushes_dir}.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: identifier of MyPaint brush GimpData using ${mypaint_brushes_dir}.
- Date: Sat, 28 Apr 2018 22:42:11 +0000 (UTC)
commit f6b586237cb8c912c1503f8e6086edd17f07d4df
Author: Jehan <jehan girinstud io>
Date: Sun Apr 29 00:32:21 2018 +0200
app: identifier of MyPaint brush GimpData using ${mypaint_brushes_dir}.
Absolute paths not to be used in $XDG_CONFIG/GIMP/{version}/tags.xml.
These are actually only an identifier, and not used as a path at all
anyway. Moreover MyPaint brushes even generate checksum (which allows
to remap the GimpData appropriately even if the paths are changing).
But anyway it's better not to have absolute paths when we can prevent
so.
app/core/Makefile.am | 1 +
app/core/gimpdata.c | 8 ++++++++
2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/app/core/Makefile.am b/app/core/Makefile.am
index 1d4855f..792bb02 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -19,6 +19,7 @@ AM_CPPFLAGS = \
$(GEGL_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
$(LIBMYPAINT_CFLAGS) \
+ $(MYPAINT_BRUSHES_CFLAGS) \
$(GEXIV2_CFLAGS) \
-I$(includedir)
diff --git a/app/core/gimpdata.c b/app/core/gimpdata.c
index 5dcc26e..f909ed8 100644
--- a/app/core/gimpdata.c
+++ b/app/core/gimpdata.c
@@ -498,6 +498,14 @@ gimp_data_get_identifier (GimpTagged *tagged)
identifier = g_filename_to_utf8 (tmp, -1, NULL, NULL, NULL);
g_free (tmp);
}
+ else if (g_str_has_prefix (path, MYPAINT_BRUSHES_DIR))
+ {
+ tmp = g_strconcat ("${mypaint_brushes_dir}",
+ path + strlen (MYPAINT_BRUSHES_DIR),
+ NULL);
+ identifier = g_filename_to_utf8 (tmp, -1, NULL, NULL, NULL);
+ g_free (tmp);
+ }
else
{
identifier = g_filename_to_utf8 (path, -1,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]