From cd5e15cc4983fa8c8cd63b57d0b9009c3fa2f1fa Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Fri, 28 Nov 2008 16:56:41 +0000 Subject: [PATCH] Fixed bug with iface props, they were getting listed once per implementing * gladeui/glade-widget-adaptor.c: Fixed bug with iface props, they were getting listed once per implementing subclass (subclasses of implementors had it listed > 2 times). svn path=/trunk/; revision=2058 --- ChangeLog | 3 +++ gladeui/glade-widget-adaptor.c | 30 ++++++++++-------------------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d5f5183..c777b652 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * gladeui/glade-inspector.c: Added GCompletion/GtkTreeModelFilter to the inspector with a new search entry. + * gladeui/glade-widget-adaptor.c: Fixed bug with iface props, they were getting listed + once per implementing subclass (subclasses of implementors had it listed > 2 times). + 2008-11-25 Tristan Van Berkom * gladeui/glade-utils.c: Hijack the cntl-n accelerator too now. diff --git a/gladeui/glade-widget-adaptor.c b/gladeui/glade-widget-adaptor.c index b9cae896..b9b038c6 100644 --- a/gladeui/glade-widget-adaptor.c +++ b/gladeui/glade-widget-adaptor.c @@ -405,31 +405,21 @@ gwa_setup_introspected_props_from_pspecs (GladeWidgetAdaptor *adaptor, { GladeWidgetAdaptor *parent_adaptor = gwa_get_parent_adaptor (adaptor); GladePropertyClass *property_class; - GType class_type; gint i; GList *list = NULL; for (i = 0; i < n_specs; i++) { - gboolean found; - - /* Only create properties that dont exist on the adaptor yet */ - for (found = FALSE, class_type = adaptor->type; - ((!parent_adaptor && class_type != 0) || - ( parent_adaptor && class_type != parent_adaptor->type)); - class_type = g_type_parent (class_type)) - if (specs[i]->owner_type == class_type || - (G_TYPE_IS_INTERFACE (specs[i]->owner_type) && - glade_util_class_implements_interface (class_type, specs[i]->owner_type))) - { - found = TRUE; - break; - } - - if (found && - (property_class = - glade_property_class_new_from_spec (adaptor, specs[i])) != NULL) - list = g_list_prepend (list, property_class); + if (parent_adaptor == NULL || + (!is_packing && !glade_widget_adaptor_get_property_class (parent_adaptor, + specs[i]->name)) || + (is_packing && !glade_widget_adaptor_get_pack_property_class (parent_adaptor, + specs[i]->name))) + { + if ((property_class = + glade_property_class_new_from_spec (adaptor, specs[i])) != NULL) + list = g_list_prepend (list, property_class); + } } if (is_packing)