diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-09-21 22:28:00 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-09-27 21:11:27 +0800 |
commit | d3531f4364469ba8dd2840974d55c87712544eda (patch) | |
tree | 762921445cb0468e8fd65b1d842925808278de3c | |
parent | ef81d18e65bb14cbd98cf07eb9d899f9c628d70e (diff) | |
download | gsoc2013-empathy-d3531f4364469ba8dd2840974d55c87712544eda.tar gsoc2013-empathy-d3531f4364469ba8dd2840974d55c87712544eda.tar.gz gsoc2013-empathy-d3531f4364469ba8dd2840974d55c87712544eda.tar.bz2 gsoc2013-empathy-d3531f4364469ba8dd2840974d55c87712544eda.tar.lz gsoc2013-empathy-d3531f4364469ba8dd2840974d55c87712544eda.tar.xz gsoc2013-empathy-d3531f4364469ba8dd2840974d55c87712544eda.tar.zst gsoc2013-empathy-d3531f4364469ba8dd2840974d55c87712544eda.zip |
don't connect on the TransferredBytesChanged D-Bus signal
https://bugzilla.gnome.org/show_bug.cgi?id=658245
-rw-r--r-- | libempathy/empathy-tp-file.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c index 7698ce7e1..c7a6a7073 100644 --- a/libempathy/empathy-tp-file.c +++ b/libempathy/empathy-tp-file.c @@ -447,12 +447,13 @@ tp_file_state_changed_cb (TpChannel *proxy, } static void -tp_file_transferred_bytes_changed_cb (TpChannel *proxy, - guint64 count, - gpointer user_data, - GObject *weak_object) +tp_file_transferred_bytes_changed_cb (TpFileTransferChannel *channel, + GParamSpec *spec, + EmpathyTpFile *self) { - EmpathyTpFile *self = (EmpathyTpFile *) weak_object; + guint64 count; + + count = tp_file_transfer_channel_get_transferred_bytes (channel); /* don't notify for 0 bytes count */ if (count == 0) @@ -460,8 +461,7 @@ tp_file_transferred_bytes_changed_cb (TpChannel *proxy, /* notify clients */ if (self->priv->progress_callback != NULL) - self->priv->progress_callback (EMPATHY_TP_FILE (weak_object), - count, self->priv->progress_user_data); + self->priv->progress_callback (self, count, self->priv->progress_user_data); } static void @@ -725,9 +725,8 @@ do_constructed (GObject *object) tp_cli_channel_type_file_transfer_connect_to_file_transfer_state_changed ( channel, tp_file_state_changed_cb, NULL, NULL, object, NULL); - tp_cli_channel_type_file_transfer_connect_to_transferred_bytes_changed ( - channel, tp_file_transferred_bytes_changed_cb, - NULL, NULL, object, NULL); + g_signal_connect (self, "notify::transferred-bytes", + G_CALLBACK (tp_file_transferred_bytes_changed_cb), self); tp_cli_dbus_properties_call_get (channel, -1, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "State", tp_file_get_state_cb, |