[gtk/wip/otte/listview: 1/82] builder: Allow parsing G_TYPE_BYTES from strings



commit d42833fdd2ebc33fcc72bba11f383441584addd3
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]