[gtk/wip/otte/listview: 3/100] builder: Allow parsing G_TYPE_BYTES from strings
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/listview: 3/100] builder: Allow parsing G_TYPE_BYTES from strings
- Date: Tue, 29 Oct 2019 03:56:56 +0000 (UTC)
commit 4cca27a7af280e0553d94152f18ea7024f4edbc7
Author: Benjamin Otte <otte redhat com>
Date: Mon Oct 21 04:57:03 2019 +0200
builder: Allow parsing G_TYPE_BYTES from strings
Just create a bytes containing the literal string.
gtk/gtkbuilder.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index b3f27ade31..78f3fee3f8 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -2095,6 +2095,10 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
gchar **vector = g_strsplit (string, "\n", 0);
g_value_take_boxed (value, vector);
}
+ else if (G_VALUE_HOLDS (value, G_TYPE_BYTES))
+ {
+ g_value_take_boxed (value, g_bytes_new (string, strlen (string)));
+ }
else
{
g_set_error (error,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]