diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2010-06-13 21:02:05 +0300 |
---|---|---|
committer | Felipe Contreras <felipe.contreras@gmail.com> | 2010-06-14 03:13:33 +0300 |
commit | 7897d019f1a5a4844a2f656b005a57db87324b75 (patch) | |
tree | b9dfb5b3eb4d97711074da178ded3a162151049b | |
parent | 19ee247852f343d5d1988cfc35420af48be82eff (diff) |
ns: listen for "open" signal
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
-rw-r--r-- | pn_ns.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -7,6 +7,7 @@ static void *parent_class; struct pn_ns_priv { struct pn_session *session; + gulong open_sig_handler; }; enum { @@ -29,6 +30,12 @@ pn_ns_free(struct pn_ns *ns) g_object_unref(ns); } +static void +open_cb(struct pn_ns *self) +{ + /* stub */ +} + /* GObject stuff */ static void @@ -39,6 +46,8 @@ instance_init(GTypeInstance *instance, struct pn_ns_priv *priv = self->priv; self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE(instance, PN_NS_TYPE, struct pn_ns_priv); + + priv->open_sig_handler = g_signal_connect(self, "open", G_CALLBACK(open_cb), NULL); } static void @@ -78,11 +87,25 @@ set_property(GObject *object, } static void +dispose(GObject *obj) +{ + struct pn_ns *self = PN_NS(obj); + struct pn_ns_priv *priv = self->priv; + + if (priv->open_sig_handler) { + g_signal_handler_disconnect(self, priv->open_sig_handler); + priv->open_sig_handler = 0; + } + G_OBJECT_CLASS(parent_class)->dispose(obj); +} + +static void class_init(void *g_class, void *class_data) { GObjectClass *gobject_class = G_OBJECT_CLASS(g_class); + gobject_class->dispose = dispose; gobject_class->get_property = get_property; gobject_class->set_property = set_property; |