[glade/composite-templates-new: 2/6] GtkIconFactory adaptor: Added a destroy_object function
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/composite-templates-new: 2/6] GtkIconFactory adaptor: Added a destroy_object function
- Date: Sat, 6 Apr 2013 06:45:23 +0000 (UTC)
commit 2f05655cd3b3aec97a4104d946385956f8967c86
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Sat Apr 6 15:42:03 2013 +0900
GtkIconFactory adaptor: Added a destroy_object function
The GtkIconFactory adaptor adds the factory to the default
with gtk_icon_factory_add_default() at post create time, now
we remove it at destroy object time.
Enabled the create-objects test for GtkIconFactory which now
passes again.
plugins/gtk+/glade-gtk.c | 9 +++++++++
plugins/gtk+/gtk+.xml.in | 1 +
tests/create-widgets.c | 2 --
3 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index e729df5..d6e53f1 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -7856,6 +7856,15 @@ glade_gtk_icon_factory_post_create (GladeWidgetAdaptor * adaptor,
gtk_icon_factory_add_default (GTK_ICON_FACTORY (object));
}
+void
+glade_gtk_icon_factory_destroy_object (GladeWidgetAdaptor * adaptor,
+ GObject *object)
+{
+ gtk_icon_factory_remove_default (GTK_ICON_FACTORY (object));
+
+ GWA_GET_CLASS (G_TYPE_OBJECT)->destroy_object (adaptor, object);
+}
+
static void
glade_gtk_icon_factory_read_sources (GladeWidget * widget, GladeXmlNode * node)
{
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index 1db8985..672c32f 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -2300,6 +2300,7 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkIconFactory" generic-name="iconfactory" _title="Icon Factory"
toplevel="True">
<post-create-function>glade_gtk_icon_factory_post_create</post-create-function>
+ <destroy-object-function>glade_gtk_icon_factory_destroy_object</destroy-object-function>
<read-widget-function>glade_gtk_icon_factory_read_widget</read-widget-function>
<write-widget-function>glade_gtk_icon_factory_write_widget</write-widget-function>
<set-property-function>glade_gtk_icon_factory_set_property</set-property-function>
diff --git a/tests/create-widgets.c b/tests/create-widgets.c
index c1e9b6d..605ea26 100644
--- a/tests/create-widgets.c
+++ b/tests/create-widgets.c
@@ -99,8 +99,6 @@ main (int argc,
if (G_TYPE_IS_INSTANTIATABLE (adaptor_type) && !G_TYPE_IS_ABSTRACT (adaptor_type) &&
/* FIXME: Status Icon crashes at dispose time unrealizing it's GtkTrayIcon without a window */
adaptor_type != GTK_TYPE_STATUS_ICON &&
- /* FIXME: Icon factory adds itself to the default but never removes itself */
- adaptor_type != GTK_TYPE_ICON_FACTORY &&
/* FIXME: FileChooserButton leaks a GTask which will crash in the following test */
adaptor_type != GTK_TYPE_FILE_CHOOSER_BUTTON &&
/* FIXME: App choosers leak some async operations after finalization, causing subsequent tests to
fail */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]