diff options
author | Benjamin Otte <otte@redhat.com> | 2019-10-21 04:57:03 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-10-29 04:56:19 +0100 |
commit | 4cca27a7af280e0553d94152f18ea7024f4edbc7 (patch) | |
tree | fc7297692d110949832571f629d2784587110e31 /gtk/gtkbuilder.c | |
parent | 553a9c292d5b6de2f4c413dd74edd81183eff818 (diff) | |
download | gtk+-4cca27a7af280e0553d94152f18ea7024f4edbc7.tar.gz |
builder: Allow parsing G_TYPE_BYTES from strings
Just create a bytes containing the literal string.
Diffstat (limited to 'gtk/gtkbuilder.c')
-rw-r--r-- | gtk/gtkbuilder.c | 4 |
1 files changed, 4 insertions, 0 deletions
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, |