[Glade-devel] Trivial patch for glade-widget.c commited.



--=-=-=

Here's the patch :-)


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
  filename=glade3-property-set-fuction.patch

? autom4te-2.53.cache
? bah.glade3
? glade-3.desktop
? stamp-h1
? src/bah.glade3
? src/glade-3
? src/go.glade3
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/glade3/ChangeLog,v
retrieving revision 1.178
diff -u -r1.178 ChangeLog
--- ChangeLog   3 Aug 2003 22:31:21 -0000       1.178
+++ ChangeLog   4 Aug 2003 22:53:55 -0000
@@ -1,3 +1,11 @@
+2003-08-05  Archit Baweja  <bighead users sourceforge net>
+
+       * src/glade-property.c (glade_property_set): when using custom 
+       set_function, copy the GValue for the property. Fixes a couple of bugs.
+
+       * src/glade-widget.c (glade_widget_new_from_node_real): set properties
+       after setting children.
+
 2003-08-04  Archit Baweja  <bighead users sourceforge net>
 
        * src/glade-widget.c (glade_widget_query_properties): have the buttons
Index: src/glade-property.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-property.c,v
retrieving revision 1.34
diff -u -r1.34 glade-property.c
--- src/glade-property.c        26 Jul 2003 17:21:51 -0000      1.34
+++ src/glade-property.c        4 Aug 2003 22:54:04 -0000
@@ -226,11 +226,14 @@
        property->loading = TRUE;
 
        /* if there is a custom set_property use it*/
-       if (property->class->set_function)
+       if (property->class->set_function) {
+               g_value_reset (property->value);
+               g_value_copy (value, property->value);
                (*property->class->set_function) (G_OBJECT (property->widget->widget),
-                                                 property->value);
-       else
+                                                 value);
+       } else {
                glade_property_set_property (property, value);
+       }
 
        property->loading = FALSE;
 
Index: src/glade-widget.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-widget.c,v
retrieving revision 1.62
diff -u -r1.62 glade-widget.c
--- src/glade-widget.c  3 Aug 2003 22:31:23 -0000       1.62
+++ src/glade-widget.c  4 Aug 2003 22:54:08 -0000
@@ -856,6 +856,7 @@
                        gint temp;
                        glade_property_query_result_get_int (result, pclass->id, &temp);
                        property = glade_property_get_from_id (widget->properties, pclass->id);
+
                        g_value_set_int (value, temp);
                        glade_property_set (property, value);
                }
@@ -1277,6 +1278,7 @@
 
        class_name = glade_xml_get_property_string_required (node, GLADE_XML_TAG_CLASS, NULL);
        widget_name = glade_xml_get_property_string_required (node, GLADE_XML_TAG_ID, NULL);
+
        if (!class_name || !widget_name)
                return NULL;
        class = glade_widget_class_get_by_name (class_name);
@@ -1287,17 +1289,6 @@
                return NULL;
        glade_widget_set_name (widget, widget_name);
 
-       /* Properties */
-       child = glade_xml_node_get_children (node);
-       for (; child; child = glade_xml_node_next (child)) {
-               if (!glade_xml_node_verify_silent (child, GLADE_XML_TAG_PROPERTY))
-                       continue;
-
-               if (!glade_widget_apply_property_from_node (child, widget)) {
-                       return NULL;
-               }
-       }
-
        /* Signals */
        child = glade_xml_node_get_children (node);
        for (; child; child = glade_xml_node_next (child)) {
@@ -1317,6 +1308,17 @@
                        continue;
 
                if (!glade_widget_new_child_from_node (child, project, widget)) {
+                       return NULL;
+               }
+       }
+
+       /* Properties */
+       child = glade_xml_node_get_children (node);
+       for (; child; child = glade_xml_node_next (child)) {
+               if (!glade_xml_node_verify_silent (child, GLADE_XML_TAG_PROPERTY))
+                       continue;
+
+               if (!glade_widget_apply_property_from_node (child, widget)) {
                        return NULL;
                }
        }

--=-=-=--




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