aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-file.c
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-11-22 00:15:10 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-11-22 00:15:10 +0800
commit29f5bf288c8eaabe674ea9c79ffe940cb46d324c (patch)
treec6f9e51f44de322d3aa0f64a6365e65904b5cfd3 /libempathy/empathy-file.c
parent094c9288f0c55f93c4c12347ed6bd3635e0cd7bc (diff)
downloadgsoc2013-empathy-29f5bf288c8eaabe674ea9c79ffe940cb46d324c.tar
gsoc2013-empathy-29f5bf288c8eaabe674ea9c79ffe940cb46d324c.tar.gz
gsoc2013-empathy-29f5bf288c8eaabe674ea9c79ffe940cb46d324c.tar.bz2
gsoc2013-empathy-29f5bf288c8eaabe674ea9c79ffe940cb46d324c.tar.lz
gsoc2013-empathy-29f5bf288c8eaabe674ea9c79ffe940cb46d324c.tar.xz
gsoc2013-empathy-29f5bf288c8eaabe674ea9c79ffe940cb46d324c.tar.zst
gsoc2013-empathy-29f5bf288c8eaabe674ea9c79ffe940cb46d324c.zip
Handled TransferredBytes signal properly and show in the progress bar. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1758 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'libempathy/empathy-file.c')
-rw-r--r--libempathy/empathy-file.c24
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");
}