From accb8e317314854fa94742c2e7198bd023b09b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 6 May 2021 15:32:44 +0200 Subject: [PATCH] emoji: Use a portable and configuration-dependent path to load the data Load the emojis data in all the platforms, respecting the configured GTK_DATA_PREFIX --- gtk/gtkemojichooser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c index b6e22d21a3..a0b827dd02 100644 --- a/gtk/gtkemojichooser.c +++ b/gtk/gtkemojichooser.c @@ -496,11 +496,15 @@ get_emoji_data (void) if (g_error_matches (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND)) { char *filename; + char *gresource_name; GMappedFile *file; g_clear_error (&error); - filename = g_strconcat ("/usr/share/gtk-3.0/emoji/", lang, ".gresource", NULL); + gresource_name = g_strconcat (lang, ".gresource", NULL); + filename = g_build_filename (_gtk_get_data_prefix (), "share", "gtk-3.0", + "emoji", gresource_name, NULL); + g_clear_pointer (&gresource_name, g_free); file = g_mapped_file_new (filename, FALSE, NULL); if (file)