diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-01-10 00:14:01 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-10 00:14:01 +0800 |
commit | f2b92d8dbeae2d666e8a777f38519b524aee78f9 (patch) | |
tree | 983bffc344d837bd08d313fdea289b4cc3f5d8be /src | |
parent | a383123730c8721724842bd942c9d997dce87059 (diff) | |
download | gsoc2013-empathy-f2b92d8dbeae2d666e8a777f38519b524aee78f9.tar gsoc2013-empathy-f2b92d8dbeae2d666e8a777f38519b524aee78f9.tar.gz gsoc2013-empathy-f2b92d8dbeae2d666e8a777f38519b524aee78f9.tar.bz2 gsoc2013-empathy-f2b92d8dbeae2d666e8a777f38519b524aee78f9.tar.lz gsoc2013-empathy-f2b92d8dbeae2d666e8a777f38519b524aee78f9.tar.xz gsoc2013-empathy-f2b92d8dbeae2d666e8a777f38519b524aee78f9.tar.zst gsoc2013-empathy-f2b92d8dbeae2d666e8a777f38519b524aee78f9.zip |
Initialize with a EmpathyTpCall instead of a TpChannel and explicitly close the
channel after uses
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
svn path=/trunk/; revision=2162
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-call-window.c | 27 | ||||
-rw-r--r-- | src/empathy-call-window.h | 4 |
2 files changed, 20 insertions, 11 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index 324f37c1e..fe1c23aa9 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -62,6 +62,8 @@ typedef struct GtkWidget *keypad_expander; } EmpathyCallWindow; +static void call_window_update (EmpathyCallWindow *window); + static GSList *windows = NULL; static gboolean @@ -152,6 +154,11 @@ call_window_finalize (EmpathyCallWindow *window) call_window_set_output_video_is_drawing (window, FALSE); empathy_tp_call_remove_preview_video (window->call, gtk_socket_get_id (GTK_SOCKET (window->preview_video_socket))); + + g_signal_handlers_disconnect_by_func (window->call, + call_window_update, window); + + empathy_tp_call_close (window->call); g_object_unref (window->call); window->call = NULL; } @@ -491,21 +498,21 @@ call_window_dtmf_connect (GladeXML *glade, } GtkWidget * -empathy_call_window_new (TpChannel *channel) +empathy_call_window_new (EmpathyTpCall *call) { EmpathyCallWindow *window; GladeXML *glade; gchar *filename; const gchar *icons[] = {"audio-input-microphone", NULL}; - g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL); + g_return_val_if_fail (EMPATHY_IS_TP_CALL (call), NULL); if (windows) { window = (EmpathyCallWindow*) windows->data; if (!window->call) { - window->call = empathy_tp_call_new (channel); + window->call = g_object_ref (call); g_signal_connect_swapped (G_OBJECT (window->call), "notify", G_CALLBACK (call_window_update), window); call_window_update (window); @@ -520,11 +527,13 @@ empathy_call_window_new (TpChannel *channel) { GtkWidget *dialog; EmpathyContact *contact; - EmpathyTpGroup *tp_group; + TpChannel *channel; + + g_object_get ( G_OBJECT (call), + "contact", &contact, + "channel", &channel, + NULL); - tp_group = empathy_tp_group_new (channel); - empathy_run_until_ready (tp_group); - empathy_tp_group_get_invitation (tp_group, &contact); empathy_contact_run_until_ready (contact, EMPATHY_CONTACT_READY_NAME, NULL); @@ -538,7 +547,7 @@ empathy_call_window_new (TpChannel *channel) " running call."), empathy_contact_get_name (contact)); g_object_unref (contact); - g_object_unref (tp_group); + g_object_unref (channel); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); @@ -551,7 +560,7 @@ empathy_call_window_new (TpChannel *channel) window = g_slice_new0 (EmpathyCallWindow); windows = g_slist_prepend (windows, window); - window->call = empathy_tp_call_new (channel); + window->call = g_object_ref (call); filename = empathy_file_lookup ("empathy-call-window.glade", "src"); glade = empathy_glade_get_file (filename, diff --git a/src/empathy-call-window.h b/src/empathy-call-window.h index 018babe9b..eef1c9a99 100644 --- a/src/empathy-call-window.h +++ b/src/empathy-call-window.h @@ -26,11 +26,11 @@ #include <gtk/gtk.h> -#include <telepathy-glib/channel.h> +#include <libempathy/empathy-tp-call.h> G_BEGIN_DECLS -GtkWidget *empathy_call_window_new (TpChannel *channel); +GtkWidget *empathy_call_window_new (EmpathyTpCall *call); G_END_DECLS |