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 ac1b8f66b1
commit 7937da632a
2 changed files with 6 additions and 6 deletions

View File

@ -159,8 +159,8 @@ add_recent_item (GtkEmojiChooser *chooser,
g_variant_ref (item);
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a((aus)u)"));
g_variant_builder_add (&builder, "(@(aus)u)", item, modifier);
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a((auss)u)"));
g_variant_builder_add (&builder, "(@(auss)u)", item, modifier);
children = gtk_container_get_children (GTK_CONTAINER (chooser->recent.box));
for (l = children, i = 1; l; l = l->next, i++)
@ -180,7 +180,7 @@ add_recent_item (GtkEmojiChooser *chooser,
continue;
}
g_variant_builder_add (&builder, "(@(aus)u)", item2, modifier2);
g_variant_builder_add (&builder, "(@(auss)u)", item2, modifier2);
}
g_list_free (children);
@ -333,7 +333,7 @@ populate_emoji_chooser (GtkEmojiChooser *chooser)
GtkWidget *box;
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);
box = chooser->people.box;

View File

@ -2,12 +2,12 @@
<schemalist>
<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>
<summary>Recently used Emoji</summary>
<description>
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
codepoint array.
</description>