aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-02-16 05:29:20 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-02-16 05:29:20 +0800
commitaec4141672783925d11bff56f9cd5019ef62c3c5 (patch)
treec638749ad5148db4397b51ab833423a37cc29bc5
parentfefd48ada4f353f364ff7ea1d1bf661a7e84180d (diff)
downloadgsoc2013-empathy-aec4141672783925d11bff56f9cd5019ef62c3c5.tar
gsoc2013-empathy-aec4141672783925d11bff56f9cd5019ef62c3c5.tar.gz
gsoc2013-empathy-aec4141672783925d11bff56f9cd5019ef62c3c5.tar.bz2
gsoc2013-empathy-aec4141672783925d11bff56f9cd5019ef62c3c5.tar.lz
gsoc2013-empathy-aec4141672783925d11bff56f9cd5019ef62c3c5.tar.xz
gsoc2013-empathy-aec4141672783925d11bff56f9cd5019ef62c3c5.tar.zst
gsoc2013-empathy-aec4141672783925d11bff56f9cd5019ef62c3c5.zip
Simplifies empathy_call_with_contact_id.
svn path=/trunk/; revision=636
-rw-r--r--libempathy/empathy-utils.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 7548c58fb..6bb346230 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -464,24 +464,18 @@ empathy_call_with_contact (EmpathyContact *contact)
}
#ifdef HAVE_VOIP
-struct empathy_call_cb_user_data {
- guint handler;
- GObject *factory;
-};
-
static void
-empathy_call_with_contact_id_got_handle_cb (EmpathyContact *contact,
- GParamSpec *property, gpointer user_data) {
-
- struct empathy_call_cb_user_data *ud =
- (struct empathy_call_cb_user_data *) user_data;
-
- g_signal_handler_disconnect (contact, ud->handler);
+got_handle_cb (EmpathyContact *contact,
+ GParamSpec *property,
+ EmpathyContactFactory *factory)
+{
+ g_signal_handlers_disconnect_by_func (contact,
+ got_handle_cb,
+ factory);
empathy_call_with_contact (contact);
- g_object_unref (ud->factory);
+ g_object_unref (factory);
g_object_unref (contact);
- g_free (ud);
}
#endif
@@ -500,13 +494,10 @@ empathy_call_with_contact_id (McAccount *account, const gchar *contact_id)
g_object_unref (contact);
g_object_unref (factory);
} else {
- struct empathy_call_cb_user_data *ud;
- ud = g_malloc0 (sizeof (struct empathy_call_cb_user_data));
- ud->factory = G_OBJECT (factory);
- ud->handler = g_signal_connect (G_OBJECT (contact), "notify::handle",
- G_CALLBACK (empathy_call_with_contact_id_got_handle_cb), ud);
+ g_signal_connect (contact, "notify::handle",
+ G_CALLBACK (got_handle_cb),
+ factory);
}
-
#endif
}