Handle emoji data change in emoji chooser

Update the settings schema to follow the change in Emoji data,
and make the emoji chooser code handle the new format.
This commit is contained in:
Matthias Clasen 2017-08-19 14:05:48 -04:00
parent bdff792462
commit cfdb9f95dc
2 changed files with 6 additions and 6 deletions

View File

@ -176,8 +176,8 @@ add_recent_item (GtkEmojiChooser *chooser,
g_variant_ref (item); g_variant_ref (item);
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a((aus)u)")); g_variant_builder_init (&builder, G_VARIANT_TYPE ("a((auss)u)"));
g_variant_builder_add (&builder, "(@(aus)u)", item, modifier); g_variant_builder_add (&builder, "(@(auss)u)", item, modifier);
children = gtk_container_get_children (GTK_CONTAINER (chooser->recent.box)); children = gtk_container_get_children (GTK_CONTAINER (chooser->recent.box));
for (l = children, i = 1; l; l = l->next, i++) for (l = children, i = 1; l; l = l->next, i++)
@ -197,7 +197,7 @@ add_recent_item (GtkEmojiChooser *chooser,
continue; continue;
} }
g_variant_builder_add (&builder, "(@(aus)u)", item2, modifier2); g_variant_builder_add (&builder, "(@(auss)u)", item2, modifier2);
} }
g_list_free (children); g_list_free (children);
@ -371,7 +371,7 @@ populate_emoji_chooser (GtkEmojiChooser *chooser)
GtkWidget *box; GtkWidget *box;
bytes = g_resources_lookup_data ("/org/gtk/libgtk/emoji/emoji.data", 0, NULL); bytes = g_resources_lookup_data ("/org/gtk/libgtk/emoji/emoji.data", 0, NULL);
chooser->data = g_variant_ref_sink (g_variant_new_from_bytes (G_VARIANT_TYPE ("a(aus)"), bytes, TRUE)); chooser->data = g_variant_ref_sink (g_variant_new_from_bytes (G_VARIANT_TYPE ("a(auss)"), bytes, TRUE));
g_variant_iter_init (&iter, chooser->data); g_variant_iter_init (&iter, chooser->data);
box = chooser->people.box; box = chooser->people.box;

View File

@ -2,12 +2,12 @@
<schemalist> <schemalist>
<schema id='org.gtk.Settings.EmojiChooser' path='/org/gtk/settings/emoji-chooser/'> <schema id='org.gtk.Settings.EmojiChooser' path='/org/gtk/settings/emoji-chooser/'>
<key name='recent-emoji' type='a((aus)u)'> <key name='recent-emoji' type='a((auss)u)'>
<default>[]</default> <default>[]</default>
<summary>Recently used Emoji</summary> <summary>Recently used Emoji</summary>
<description> <description>
An array of Emoji definitions to show in the Emoji chooser. Each Emoji is An array of Emoji definitions to show in the Emoji chooser. Each Emoji is
specified as an array of codepoints and a name. The extra integer after this specified as an array of codepoints, name and shortname. The extra integer after this
pair is the code of the Fitzpatrick modifier to use in place of a 0 in the pair is the code of the Fitzpatrick modifier to use in place of a 0 in the
codepoint array. codepoint array.
</description> </description>