[telepathy-mission-control/master] Add MCD_CHANNEL_STATUS_ABORTED

Alberto Mardegan alberto.mardegan at nokia.com
Tue Sep 8 02:33:45 PDT 2009


Change the channel status when a channel is aborted.
This fixes a problem with mcd_dispatcher_get_channel_type_usage(), which
otherwise can count even aborted channels.

Add a debug line to mcd_dispatcher_get_channel_type_usage().
---
 src/mcd-channel.c    |    2 ++
 src/mcd-channel.h    |    1 +
 src/mcd-dispatcher.c |    3 +++
 3 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mcd-channel.c b/src/mcd-channel.c
index 07a648f..92ba46b 100644
--- a/src/mcd-channel.c
+++ b/src/mcd-channel.c
@@ -584,6 +584,8 @@ mcd_channel_abort (McdMission *mission)
         mcd_channel_take_error (channel, error);
     }
 
+    _mcd_channel_set_status (channel, MCD_CHANNEL_STATUS_ABORTED);
+
     /* chain up with the parent */
     MCD_MISSION_CLASS (mcd_channel_parent_class)->abort (mission);
 }
diff --git a/src/mcd-channel.h b/src/mcd-channel.h
index 56fa25c..14ac8c0 100644
--- a/src/mcd-channel.h
+++ b/src/mcd-channel.h
@@ -64,6 +64,7 @@ typedef enum
                                       */
     MCD_CHANNEL_STATUS_FAILED,       /* Channel creation failed, or channel
                                         could not be dispached to a handler */
+    MCD_CHANNEL_STATUS_ABORTED,      /* Channel has been aborted */
 } McdChannelStatus;
 
 struct _McdChannel
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 2764104..d21c7a3 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -439,7 +439,10 @@ mcd_dispatcher_get_channel_type_usage (McdDispatcher * dispatcher,
                      status == MCD_CHANNEL_STATUS_DISPATCHED) &&
                     mcd_channel_get_channel_type_quark (channel) ==
                     chan_type_quark)
+                {
+                    DEBUG ("Channel %p is active", channel);
                     usage_counter++;
+                }
                 channels = channels->next;
             }
             connections = connections->next;
-- 
1.5.6.5




More information about the telepathy-commits mailing list