[gtk: 1/3] 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: 1/3] emoji: Use a portable and configuration-dependent path to load the data
- Date: Thu, 6 May 2021 15:33:16 +0000 (UTC)
commit c98dd1afb9e68a85ce8a1c86973e2cdf041f0e4f
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 646be90ed3..9a1e11b450 100644
--- a/gtk/gtkemojichooser.c
+++ b/gtk/gtkemojichooser.c
@@ -627,11 +627,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-4.0/emoji/", lang, ".gresource", NULL);
+ gresource_name = g_strconcat (lang, ".gresource", NULL);
+ filename = g_build_filename (_gtk_get_data_prefix (), "share", "gtk-4.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]