[gtk/gtk-3-24: 9/13] emoji: Use a portable and configuration-dependent path to load the data
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 9/13] emoji: Use a portable and configuration-dependent path to load the data
- Date: Fri, 14 May 2021 00:42:06 +0000 (UTC)
commit accb8e317314854fa94742c2e7198bd023b09b36
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Thu May 6 15:32:44 2021 +0200
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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]