aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus/gal-view-menus.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-06-01 07:12:02 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-06-01 07:12:02 +0800
commit8e3439ab3eea986e1d2e075dceae3aa2b9a439f1 (patch)
tree67d0c31d8b07e73a7f8451dd9cdcc4f45ad6340d /widgets/menus/gal-view-menus.c
parentbe88a44705a7decc5cf3fb87704f1d6608fea857 (diff)
downloadgsoc2013-evolution-8e3439ab3eea986e1d2e075dceae3aa2b9a439f1.tar.gz
gsoc2013-evolution-8e3439ab3eea986e1d2e075dceae3aa2b9a439f1.tar.zst
gsoc2013-evolution-8e3439ab3eea986e1d2e075dceae3aa2b9a439f1.zip
Store the connection ID of the "changed" signal in the collection.
2001-05-31 Federico Mena Quintero <federico@ximian.com> * menus/gal-view-menus.c (gal_view_menus_construct): Store the connection ID of the "changed" signal in the collection. (gal_view_menus_new): Added preconditions. (gal_view_menus_construct): Added preconditions. svn path=/trunk/; revision=10075
Diffstat (limited to 'widgets/menus/gal-view-menus.c')
-rw-r--r--widgets/menus/gal-view-menus.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/widgets/menus/gal-view-menus.c b/widgets/menus/gal-view-menus.c
index 89eb38022a..1e22f5efc8 100644
--- a/widgets/menus/gal-view-menus.c
+++ b/widgets/menus/gal-view-menus.c
@@ -90,10 +90,12 @@ gvm_destroy (GtkObject *object)
if (gvm->priv->collection && gvm->priv->collection_changed_id != 0) {
gtk_signal_disconnect(GTK_OBJECT(gvm->priv->collection), gvm->priv->collection_changed_id);
+ gvm->priv->collection_changed_id = 0;
}
if (gvm->priv->collection)
gtk_object_unref(GTK_OBJECT(gvm->priv->collection));
+
free_verbs(gvm);
remove_xml(gvm);
remove_listeners(gvm);
@@ -127,8 +129,12 @@ E_MAKE_TYPE(gal_view_menus, "GalViewMenus", GalViewMenus, gvm_class_init, gvm_in
GalViewMenus *
gal_view_menus_new (GalViewCollection *collection)
{
- GalViewMenus *gvm = gtk_type_new (GAL_VIEW_MENUS_TYPE);
+ GalViewMenus *gvm;
+
+ g_return_val_if_fail (collection != NULL, NULL);
+ g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
+ gvm = gtk_type_new (GAL_VIEW_MENUS_TYPE);
gal_view_menus_construct(gvm, collection);
return gvm;
@@ -138,12 +144,17 @@ GalViewMenus *
gal_view_menus_construct (GalViewMenus *gvm,
GalViewCollection *collection)
{
- if (collection)
- gtk_object_ref(GTK_OBJECT(collection));
+ g_return_val_if_fail (gvm != NULL, NULL);
+ g_return_val_if_fail (GAL_IS_VIEW_MENUS (gvm), NULL);
+ g_return_val_if_fail (collection != NULL, NULL);
+ g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
+
+ gtk_object_ref(GTK_OBJECT(collection));
gvm->priv->collection = collection;
+ gvm->priv->collection_changed_id = gtk_signal_connect (
+ GTK_OBJECT(collection), "changed",
+ GTK_SIGNAL_FUNC(collection_changed), gvm);
- gtk_signal_connect(GTK_OBJECT(collection), "changed",
- GTK_SIGNAL_FUNC(collection_changed), gvm);
return gvm;
}
@@ -298,9 +309,10 @@ build_stuff (GalViewMenus *gvm,
bonobo_ui_component_add_verb_list(gvm->priv->component, gvm->priv->verbs);
}
-void gal_view_menus_apply (GalViewMenus *gvm,
- BonoboUIComponent *component,
- CORBA_Environment *ev)
+void
+gal_view_menus_apply (GalViewMenus *gvm,
+ BonoboUIComponent *component,
+ CORBA_Environment *ev)
{
gvm->priv->component = component;