aboutsummaryrefslogtreecommitdiffstats
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
parentbe88a44705a7decc5cf3fb87704f1d6608fea857 (diff)
downloadgsoc2013-evolution-8e3439ab3eea986e1d2e075dceae3aa2b9a439f1.tar
gsoc2013-evolution-8e3439ab3eea986e1d2e075dceae3aa2b9a439f1.tar.gz
gsoc2013-evolution-8e3439ab3eea986e1d2e075dceae3aa2b9a439f1.tar.bz2
gsoc2013-evolution-8e3439ab3eea986e1d2e075dceae3aa2b9a439f1.tar.lz
gsoc2013-evolution-8e3439ab3eea986e1d2e075dceae3aa2b9a439f1.tar.xz
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
-rw-r--r--widgets/ChangeLog7
-rw-r--r--widgets/menus/gal-view-menus.c28
-rw-r--r--widgets/menus/gal-view-menus.h2
3 files changed, 28 insertions, 9 deletions
diff --git a/widgets/ChangeLog b/widgets/ChangeLog
index b9ada966b1..30f47dc6ee 100644
--- a/widgets/ChangeLog
+++ b/widgets/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2001-05-21 Chris Toshok <toshok@ximian.com>
* menus/gal-view-menus.c (build_menus): make the view menuitems
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;
diff --git a/widgets/menus/gal-view-menus.h b/widgets/menus/gal-view-menus.h
index 21b302771c..bc62d82f54 100644
--- a/widgets/menus/gal-view-menus.h
+++ b/widgets/menus/gal-view-menus.h
@@ -31,6 +31,6 @@ GalViewMenus *gal_view_menus_construct (GalViewMenus *menus,
void gal_view_menus_apply (GalViewMenus *menus,
BonoboUIComponent *component,
- CORBA_Environment *ev);
+ CORBA_Environment *ev);
#endif /* _GAL_VIEW_MENUS_H_ */