[Telepathy-commits] [telepathy-gabble/master] conn-olpc: fire the Closed signal when views are closed
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Fri Sep 26 10:02:55 PDT 2008
20080804123606-7fe3f-5ac5b3c98aa77eac20a50b031f2f2d23eec3815c.gz
---
src/conn-olpc.c | 2 +-
src/olpc-view.c | 5 ++++-
tests/twisted/olpc/olpc-activity-search.py | 3 ++-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index 7abc5ae..cff5f2b 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -3783,7 +3783,7 @@ create_view (GabbleConnection *conn,
view = gabble_olpc_view_new (conn, type, id);
g_hash_table_insert (conn->olpc_views, GUINT_TO_POINTER (id), view);
- g_signal_connect (view, "closed", G_CALLBACK (view_closed_cb), conn);
+ g_signal_connect (view, "closed_", G_CALLBACK (view_closed_cb), conn);
g_signal_connect (view, "buddy-activities-changed",
G_CALLBACK (buddy_activities_changed_cb), conn);
diff --git a/src/olpc-view.c b/src/olpc-view.c
index bb58bfc..a35b296 100644
--- a/src/olpc-view.c
+++ b/src/olpc-view.c
@@ -305,8 +305,9 @@ gabble_olpc_view_class_init (GabbleOlpcViewClass *gabble_olpc_view_class)
G_PARAM_STATIC_BLURB);
g_object_class_install_property (object_class, PROP_ID, param_spec);
+ /* We can't use "closed" as it's already use for the D-Bus signal... */
signals[CLOSED] =
- g_signal_new ("closed",
+ g_signal_new ("closed_",
G_OBJECT_CLASS_TYPE (gabble_olpc_view_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
0,
@@ -478,6 +479,8 @@ gabble_olpc_view_close (GabbleOlpcView *self,
g_signal_emit (G_OBJECT (self), signals[CLOSED], 0);
+ gabble_svc_olpc_view_emit_closed (self);
+
return TRUE;
}
diff --git a/tests/twisted/olpc/olpc-activity-search.py b/tests/twisted/olpc/olpc-activity-search.py
index ed2c8e3..7a54659 100644
--- a/tests/twisted/olpc/olpc-activity-search.py
+++ b/tests/twisted/olpc/olpc-activity-search.py
@@ -35,8 +35,9 @@ def check_view(view, conn, activities, buddies):
def close_view(q, view_iface, id):
call_async(q, view_iface, 'Close')
- event, _ = q.expect_many(
+ event, _, _ = q.expect_many(
EventPattern('stream-message', to='gadget.localhost'),
+ EventPattern('dbus-signal', signal='Closed'),
EventPattern('dbus-return', method='Close'))
close = xpath.queryForNodes('/message/close', event.stanza)
assert len(close) == 1
--
1.5.6.5
More information about the Telepathy-commits
mailing list