diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2008-11-22 00:15:10 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-11-22 00:15:10 +0800 |
commit | fb83058ce074f671c6f5b06d570ea44b8ee7c628 (patch) | |
tree | c6f9e51f44de322d3aa0f64a6365e65904b5cfd3 | |
parent | 64e6014e9cf6b2038126fc5288dc398d59acbbb1 (diff) | |
download | gsoc2013-empathy-fb83058ce074f671c6f5b06d570ea44b8ee7c628.tar gsoc2013-empathy-fb83058ce074f671c6f5b06d570ea44b8ee7c628.tar.gz gsoc2013-empathy-fb83058ce074f671c6f5b06d570ea44b8ee7c628.tar.bz2 gsoc2013-empathy-fb83058ce074f671c6f5b06d570ea44b8ee7c628.tar.lz gsoc2013-empathy-fb83058ce074f671c6f5b06d570ea44b8ee7c628.tar.xz gsoc2013-empathy-fb83058ce074f671c6f5b06d570ea44b8ee7c628.tar.zst gsoc2013-empathy-fb83058ce074f671c6f5b06d570ea44b8ee7c628.zip |
Handled TransferredBytes signal properly and show in the progress bar. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1758
-rw-r--r-- | libempathy/empathy-file.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/libempathy/empathy-file.c b/libempathy/empathy-file.c index e2e13951f..c3e028a7a 100644 --- a/libempathy/empathy-file.c +++ b/libempathy/empathy-file.c @@ -87,9 +87,8 @@ static void file_state_changed_cb (DBusGProxy *file_ guint state, guint reason, EmpathyFile *file); -static void file_transferred_bytes_changed_cb (DBusGProxy *file_iface, - guint64 transferred_bytes, - EmpathyFile *file); +static void file_transferred_bytes_changed_cb (TpProxy *proxy, guint64 count, + EmpathyFile *file, GObject *weak_object); static void copy_stream (GInputStream *in, GOutputStream *out, GCancellable *cancellable); @@ -137,6 +136,7 @@ enum { PROP_FILENAME, PROP_SIZE, PROP_CONTENT_TYPE, + PROP_TRANSFERRED_BYTES, PROP_CONTENT_MD5, PROP_IN_STREAM, }; @@ -229,6 +229,16 @@ empathy_file_class_init (EmpathyFileClass *klass) G_PARAM_READWRITE)); g_object_class_install_property (object_class, + PROP_TRANSFERRED_BYTES, + g_param_spec_uint64 ("transferred-bytes", + "bytes transferred", + "The number of bytes transferred", + 0, + G_MAXUINT64, + 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_IN_STREAM, g_param_spec_object ("in-stream", "transfer input stream", @@ -751,17 +761,17 @@ file_state_changed_cb (DBusGProxy *file_iface, } static void -file_transferred_bytes_changed_cb (DBusGProxy *file_iface, - guint64 transferred_bytes, EmpathyFile *file) +file_transferred_bytes_changed_cb (TpProxy *proxy, + guint64 count, EmpathyFile *file, GObject *weak_object) { EmpathyFilePriv *priv; priv = GET_PRIV (file); - if (priv->transferred_bytes == transferred_bytes) + if (priv->transferred_bytes == count) return; - priv->transferred_bytes = transferred_bytes; + priv->transferred_bytes = count; g_object_notify (G_OBJECT (file), "transferred-bytes"); } |