3-08-24 Joaquin Cuenca Abela <e98cuenc@yahoo.com>

* src/glade-widget-class.c (glade_widget_class_remove_duplicated_properties):
	when we had a specialized property on a base widget class, if this property
	was the first one on the list of properties, the whole list was removed.
This commit is contained in:
Joaquín Cuenca Abela 2003-08-24 21:35:39 +00:00
parent f9fdfe2281
commit 1a3b4fb23e
8 changed files with 29 additions and 51 deletions

View File

@ -1,3 +1,9 @@
2003-08-24 Joaquin Cuenca Abela <e98cuenc@yahoo.com>
* src/glade-widget-class.c (glade_widget_class_remove_duplicated_properties):
when we had a specialized property on a base widget class, if this property
was the first one on the list of properties, the whole list was removed.
2003-08-21 Paolo Borelli <pborelli@katamail.com>
* src/glade-widget.[ch]: remove the tree structure (GladeWidget->parent

View File

@ -545,22 +545,36 @@ glade_widget_class_remove_duplicated_properties (GladeWidgetClass *widget_class)
GList *old_property;
/* if it's the first time we see this property, then we add it to the list of
* properties that we will keep for this widget. Idem if the last time we saw
* this property, it was not modified, and this time the property is modified
* properties that we will keep the property. Idem if the last time we saw
* this property it was not modified, and this time the property is modified
* (ie, we change the non modified property by the modified one). */
if ((old_property = g_hash_table_lookup (hash_properties, property_class->id)) == NULL ||
(!((GladePropertyClass*) old_property->data)->is_modified && property_class->is_modified))
{
/* remove the old property */
if (old_property != NULL)
{
GList *new_head = widget_class->properties;
if (old_property == widget_class->properties)
new_head = g_list_next (old_property);
g_list_remove_link (widget_class->properties, old_property);
widget_class->properties = new_head;
}
g_hash_table_insert (hash_properties, property_class->id, properties_classes);
properties_classes = g_list_next (properties_classes);
} else {
GList *tmp = properties_classes;
GList *new_head = widget_class->properties;
if (tmp == widget_class->properties)
new_head = g_list_next (tmp);
properties_classes = g_list_next (properties_classes);
g_list_remove_link (widget_class->properties, tmp);
widget_class->properties = new_head;
}
}
@ -583,6 +597,9 @@ glade_widget_class_remove_duplicated_properties (GladeWidgetClass *widget_class)
* the xml filename.
*
* Return Value: The new GladeWidgetClass, or %NULL if there are any errors.
*
* TODO: this function should replace glade_widget_class_new_from_name & new_from_node
* when done, we should of course rename it.
**/
GladeWidgetClass *
glade_widget_class_new_from_name2 (const char *name,
@ -615,7 +632,7 @@ glade_widget_class_new_from_name2 (const char *name,
goto lblError;
}
widget_class->generic_name = generic_name ? g_strdup (generic_name) : NULL;
widget_class->generic_name = g_strdup (generic_name);
widget_class->name = g_strdup (name);
widget_class->in_palette = generic_name ? TRUE : FALSE;

View File

@ -1,39 +1,9 @@
<GladeWidgetClass>
<Name>GtkAccelLabel</Name>
<GenericName>accellabel</GenericName>
<Toplevel>False</Toplevel>
<Properties>
<Property Id="label">
<Parameters>
<Parameter Key="VisibleLines" Value="1"/>
</Parameters>
</Property>
<Property Id="pattern"/>
<Property Id="justify"/>
<Property Id="use-markup"/>
<Property Id="use-underline"/>
<Property Id="wrap"/>
<Property Id="selectable"/>
<Property Id="xalign"/>
<Property Id="yalign"/>
<Property Id="xpad"/>
<Property Id="ypad"/>
<Property Id="accel-closure" Disabled="True"/>
<Property Id="accel-widget" Disabled="True"/>
<Property Common="True" Optional="True" OptionalDefault="False" Default="0" Id="width-request"/>
<Property Common="True" Optional="True" OptionalDefault="False" Default="0" Id="height-request"/>
<Property Common="True" Id="visible" Default="True"/>
<Property Common="True" Id="sensitive"/>
<Property Common="True" Id="app-paintable"/>
<Property Common="True" Id="can-default"/>
<Property Common="True" Id="has-default"/>
<Property Common="True" Id="can-focus"/>
<Property Common="True" Id="has-focus"/>
<Property Common="True" Id="receives-default"/>
<Property Common="True" Id="style" Disabled="True"/>
<Property Common="True" Id="events" Disabled="True"/>
<Property Common="True" Id="extension-events"/>

View File

@ -21,11 +21,6 @@
<Property Id="allow-grow"/>
<Property Id="allow-shrink"/>
<Property Common="True" Optional="True" OptioanlDefault="False" Default="0" Id="width-request"/>
<Property Common="True" Optional="True" OptioanlDefault="False" Default="0" Id="height-request"/>
<Property Common="True" Id="visible" Default="True">
<SetFunction>ignore</SetFunction>
</Property>
<Property Common="True" Id="sensitive"/>
<Property Common="True" Id="tooltip" ParamSpec="False" Name="Tooltip">
<Type>String</Type>

View File

@ -7,8 +7,6 @@
<Properties>
<Property Common="True" Optional="True" OptionalDefault="False" Default="0" Id="width-request"/>
<Property Common="True" Optional="True" OptionalDefault="False" Default="0" Id="height-request"/>
<Property Common="True" Id="visible" Default="True">
<SetFunction>ignore</SetFunction>
</Property>

View File

@ -19,11 +19,6 @@
<Property Id="message-type"/>
<Property Id="buttons"/>
<Property Common="True" Optional="True" OptioanlDefault="False" Default="0" Id="width-request"/>
<Property Common="True" Optional="True" OptioanlDefault="False" Default="0" Id="height-request"/>
<Property Common="True" Id="visible" Default="True">
<SetFunction>ignore</SetFunction>
</Property>
<Property Common="True" Id="sensitive"/>
<Property Common="True" Id="tooltip" ParamSpec="False" Name="Tooltip">
<Type>String</Type>

View File

@ -6,6 +6,8 @@
<SetFunction>ignore</SetFunction>
<GetFunction>ignore</GetFunction>
</Property>
<Property Common="True" Optional="True" OptionalDefault="False" Default="0" Id="width-request"/>
<Property Common="True" Optional="True" OptionalDefault="False" Default="0" Id="height-request"/>
</Properties>
</GladeWidgetClass>

View File

@ -9,9 +9,6 @@
<Property Id="default-width" Default="0" Optional="True" OptionalDefault="False"/>
<Property Id="default-height" Default="0" Optional="True" OptionalDefault="False"/>
<Property Common="True" Optional="True" OptionalDefault="False" Default="0" Id="width-request"/>
<Property Common="True" Optional="True" OptionalDefault="False" Default="0" Id="height-request"/>
<Property Common="True" Id="tooltip" ParamSpec="False" Name="Tooltip">
<Type>String</Type>
<SetFunction>glade_gtk_widget_set_tooltip</SetFunction>
@ -21,6 +18,4 @@
</Properties>
</GladeWidgetClass>