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.
This commit is contained in:
Jehan 2018-04-29 00:32:21 +02:00
parent 0c4cbbfffa
commit f6b586237c
2 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,7 @@ AM_CPPFLAGS = \
$(GEGL_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
$(LIBMYPAINT_CFLAGS) \
$(MYPAINT_BRUSHES_CFLAGS) \
$(GEXIV2_CFLAGS) \
-I$(includedir)

View File

@ -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,