diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2008-11-22 00:14:17 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-11-22 00:14:17 +0800 |
commit | 313343ff162691f676775bf7ed6d9f368d76be8f (patch) | |
tree | 5e4a8aa270ccc8c9a237d2de0c826847ef175443 /libempathy/empathy-file.c | |
parent | 3c1198a63ddfee7048992df932cc9907d17ea7df (diff) | |
download | gsoc2013-empathy-313343ff162691f676775bf7ed6d9f368d76be8f.tar gsoc2013-empathy-313343ff162691f676775bf7ed6d9f368d76be8f.tar.gz gsoc2013-empathy-313343ff162691f676775bf7ed6d9f368d76be8f.tar.bz2 gsoc2013-empathy-313343ff162691f676775bf7ed6d9f368d76be8f.tar.lz gsoc2013-empathy-313343ff162691f676775bf7ed6d9f368d76be8f.tar.xz gsoc2013-empathy-313343ff162691f676775bf7ed6d9f368d76be8f.tar.zst gsoc2013-empathy-313343ff162691f676775bf7ed6d9f368d76be8f.zip |
Push the notify::state and notify::transferred-bytes signals from EmpathyTpFile onto EmpathyFile for the ft-manager to listen to. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1745
Diffstat (limited to 'libempathy/empathy-file.c')
-rw-r--r-- | libempathy/empathy-file.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/libempathy/empathy-file.c b/libempathy/empathy-file.c index dd4079005..32bdb389e 100644 --- a/libempathy/empathy-file.c +++ b/libempathy/empathy-file.c @@ -69,6 +69,10 @@ static void file_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void file_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); +static void state_changed_cb (GObject *object, GParamSpec *pspec, + EmpathyFile *file); +static void transferred_bytes_changed_cb (GObject *object, GParamSpec *pspec, + EmpathyFile *file); static void file_set_tp_file (EmpathyFile *file, EmpathyTpFile *tp_file); enum @@ -210,6 +214,20 @@ empathy_file_init (EmpathyFile *file) } static void +state_changed_cb (GObject *object, GParamSpec *pspec, + EmpathyFile *file) +{ + g_object_notify (G_OBJECT (file), "state"); +} + +static void +transferred_bytes_changed_cb (GObject *object, GParamSpec *pspec, + EmpathyFile *file) +{ + g_object_notify (G_OBJECT (file), "transferred-bytes"); +} + +static void file_finalize (GObject *object) { EmpathyFilePriv *priv; @@ -331,9 +349,18 @@ file_set_property (GObject *object, guint param_id, const GValue *value, EmpathyFile * empathy_file_new (EmpathyTpFile *tp_file) { - return g_object_new (EMPATHY_TYPE_FILE, - "tp_file", tp_file, + EmpathyFile *file; + + file = g_object_new (EMPATHY_TYPE_FILE, + "tp-file", tp_file, NULL); + + g_signal_connect (tp_file, "notify::state", + G_CALLBACK (state_changed_cb), file); + g_signal_connect (tp_file, "notify::transferred-bytes", + G_CALLBACK (transferred_bytes_changed_cb), file); + + return file; } /** |