[glade3] Avoid updating widgets with properties floating outside the widget.



commit 3b6eacaae4d39bda870e41d3eb21843a386e82d8
Author: Tristan Van Berkom <vantr TheBully local>
Date:   Thu Jun 25 13:18:50 2009 -0400

    Avoid updating widgets with properties floating outside the widget.
    
    * gladeui/glade-property.c: glade_property_sync_impl(), dont sync properties
    that are the primary property of that klass for the said widget (properties
    can float outside of widget->properties in some cases, shouldnt effect the
    widget though).

 ChangeLog                |    7 +++++++
 gladeui/glade-property.c |   11 +++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b6556fd..2fe59cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-06-25  Tristan Van Berkom <tvb gnome org>
+
+	* gladeui/glade-property.c: glade_property_sync_impl(), dont sync properties
+	that are the primary property of that klass for the said widget (properties
+	can float outside of widget->properties in some cases, shouldnt effect the
+	widget though).
+
 2009-06-22  Tristan Van Berkom <tvb gnome org>
 
 	* configure.ac, NEWS: Rolling Glade 3.6.6
diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c
index 2fc118d..6cecae8 100644
--- a/gladeui/glade-property.c
+++ b/gladeui/glade-property.c
@@ -334,7 +334,6 @@ glade_property_get_value_impl (GladeProperty *property, GValue *value)
 static void
 glade_property_sync_impl (GladeProperty *property)
 {
-
 	/* Heh, here are the many reasons not to
 	 * sync a property ;-)
 	 */
@@ -351,6 +350,14 @@ glade_property_sync_impl (GladeProperty *property)
 	    property->widget == NULL)
 		return;
 
+	/* Only the properties from widget->properties should affect the runtime widget.
+	 * (other properties may be used for convenience in the plugin).
+	 */
+	if ((property->klass->packing && 
+	     property != glade_widget_get_pack_property (property->widget, property->klass->id)) ||
+	    property != glade_widget_get_property (property->widget, property->klass->id))
+		return;
+
 	property->syncing++;
 
 	/* In the case of construct_only, the widget instance must be rebuilt
@@ -1014,7 +1021,7 @@ glade_property_read (GladeProperty      *property,
 	GladeProjectFormat fmt;
 	GValue       *gvalue = NULL;
 	gchar        /* *id, *name, */ *value;
-	gint translatable, has_context;
+	gint translatable = FALSE, has_context = FALSE;
 	gchar *comment = NULL, *context = NULL;
 
 	g_return_if_fail (GLADE_IS_PROPERTY (property));



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