[gtk/wip/otte/listview: 34/199] builder: Allow <property bind /> for objects



commit 4ae79930f596f2daec4068d191ea7258a75f814a
Author: Benjamin Otte <otte redhat com>
Date:   Wed Dec 18 16:47:31 2019 +0100

    builder: Allow <property bind /> for objects
    
    Previously, object properties had to always be set to a value.
    This now works without it.

 gtk/gtkbuilder.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index cd65388649..d1c944844b 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -520,7 +520,14 @@ gtk_builder_get_parameters (GtkBuilder         *builder,
       const char *property_name = g_intern_string (prop->pspec->name);
       GValue property_value = G_VALUE_INIT;
 
-      if (G_IS_PARAM_SPEC_OBJECT (prop->pspec) &&
+      if (prop->bound && (!prop->text || prop->text->len == 0))
+        {
+          /* Ignore properties with a binding and no value since they are
+           * only there for to express the binding.
+           */
+          continue;
+        }
+      else if (G_IS_PARAM_SPEC_OBJECT (prop->pspec) &&
           (G_PARAM_SPEC_VALUE_TYPE (prop->pspec) != GDK_TYPE_PIXBUF) &&
           (G_PARAM_SPEC_VALUE_TYPE (prop->pspec) != GDK_TYPE_TEXTURE) &&
           (G_PARAM_SPEC_VALUE_TYPE (prop->pspec) != GDK_TYPE_PAINTABLE) &&
@@ -555,13 +562,6 @@ gtk_builder_get_parameters (GtkBuilder         *builder,
               continue;
             }
         }
-      else if (prop->bound && (!prop->text || prop->text->len == 0))
-        {
-          /* Ignore properties with a binding and no value since they are
-           * only there for to express the binding.
-           */
-          continue;
-        }
       else if (!gtk_builder_value_from_string (builder, prop->pspec,
                                                prop->text->str,
                                                &property_value,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]