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
This commit is contained in:
Marco Trevisan (Treviño) 2021-05-06 15:32:44 +02:00
parent 1a4e368c7e
commit accb8e3173

View File

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