[telepathy-mission-control/master] mcd_dispatcher_op_ready_to_dispatch_cb: move most of the code to McdDispatchOperation

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Nov 2 06:41:47 PST 2009


---
 src/mcd-dispatch-operation.c |    6 ++++++
 src/mcd-dispatcher.c         |   18 ------------------
 2 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 8f353e3..6f78a67 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -474,6 +474,12 @@ mcd_dispatch_operation_actually_finish (McdDispatchOperation *self)
         self->priv->channels_handled = TRUE;
     }
 
+    if (_mcd_dispatch_operation_is_awaiting_approval (self))
+    {
+        _mcd_dispatch_operation_set_awaiting_approval (self, FALSE);
+        _mcd_dispatch_operation_set_approved (self);
+    }
+
     g_signal_emit (self, signals[S_READY_TO_DISPATCH], 0);
 
     if (self->priv->claim_context != NULL)
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 80ec3ac..bc4903f 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -739,24 +739,6 @@ mcd_dispatcher_op_ready_to_dispatch_cb (McdDispatchOperation *operation,
     g_signal_handlers_disconnect_by_func (operation,
         mcd_dispatcher_op_ready_to_dispatch_cb, context);
 
-    /* This is emitted when the HandleWith() or Claimed() are invoked on the
-     * CDO: according to which of these have happened, we run the choosen
-     * handler or we don't. */
-
-    /* Because of our calls to _mcd_dispatch_operation_block_finished,
-     * this cannot happen until all observers and all approvers have
-     * returned from ObserveChannels or AddDispatchOperation, respectively. */
-    g_assert (!_mcd_dispatch_operation_has_ado_pending (context->operation));
-    g_assert (!_mcd_dispatch_operation_has_observers_pending
-              (context->operation));
-
-    if (_mcd_dispatch_operation_is_awaiting_approval (context->operation))
-    {
-        _mcd_dispatch_operation_set_awaiting_approval (context->operation,
-                                                       FALSE);
-        _mcd_dispatch_operation_set_approved (context->operation);
-    }
-
     mcd_dispatcher_context_unref (context, "CTXREF15");
 }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list