diff options
author | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-11-22 00:14:17 +0800 |
---|---|---|
committer | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-11-22 00:14:17 +0800 |
commit | 65b5865fb0222bf3048c475d298ceda86a15f469 (patch) | |
tree | 5e4a8aa270ccc8c9a237d2de0c826847ef175443 | |
parent | f5685dc3ddec8832833db61200e54229b4f2bda1 (diff) | |
download | gsoc2013-empathy-65b5865fb0222bf3048c475d298ceda86a15f469.tar gsoc2013-empathy-65b5865fb0222bf3048c475d298ceda86a15f469.tar.gz gsoc2013-empathy-65b5865fb0222bf3048c475d298ceda86a15f469.tar.bz2 gsoc2013-empathy-65b5865fb0222bf3048c475d298ceda86a15f469.tar.lz gsoc2013-empathy-65b5865fb0222bf3048c475d298ceda86a15f469.tar.xz gsoc2013-empathy-65b5865fb0222bf3048c475d298ceda86a15f469.tar.zst gsoc2013-empathy-65b5865fb0222bf3048c475d298ceda86a15f469.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>
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1745 4ee84921-47dd-4033-b63a-18d7a039a3e4
-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; } /** |