[Telepathy-commits] [telepathy-mission-control/master] Emit the request Failed signal as last.

Alberto Mardegan alberto.mardegan at nokia.com
Thu Jan 29 23:57:15 PST 2009


The Failed signal causes the client (using libmcclient) to delete all
references to a request; if a RemoveFailedRequest is received after that, it
cannot be mapped anymore. This change makes it so that the client will receive
RemoveFailedRequest before the Failed one, so that the client's request ID is
still valid.
---
 src/mcd-account-requests.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mcd-account-requests.c b/src/mcd-account-requests.c
index dd58bc9..59857ef 100644
--- a/src/mcd-account-requests.c
+++ b/src/mcd-account-requests.c
@@ -160,8 +160,10 @@ create_request (McdAccount *account, GHashTable *properties,
     g_hash_table_unref (props);
     _mcd_channel_set_request_use_existing (channel, use_existing);
 
-    g_signal_connect (channel, "status-changed",
-                      G_CALLBACK (on_channel_status_changed), account);
+    /* we use connect_after, to make sure that other signals (such as
+     * RemoveFailedRequest) are emitted before the Failed signal */
+    g_signal_connect_after (channel, "status-changed",
+                            G_CALLBACK (on_channel_status_changed), account);
 
     dispatcher = mcd_master_get_dispatcher (mcd_master_get_default ());
     _mcd_dispatcher_add_request (dispatcher, account, channel);
-- 
1.5.6.5




More information about the telepathy-commits mailing list