diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-07-20 13:27:19 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-07-20 14:28:38 +0100 |
commit | 60ee7341921191f2de4ec587eb098fe55488a869 (patch) | |
tree | c322ddea0131e884b36e51e953db0189b10c1953 | |
parent | 80ea4690cef4b6e2e4509df7fc9040b66ff93faf (diff) |
_mcd_dispatch_operation_new: only take one channel
https://bugs.freedesktop.org/show_bug.cgi?id=52305
-rw-r--r-- | src/mcd-dispatch-operation-priv.h | 7 | ||||
-rw-r--r-- | src/mcd-dispatch-operation.c | 12 | ||||
-rw-r--r-- | src/mcd-dispatcher.c | 5 |
3 files changed, 11 insertions, 13 deletions
diff --git a/src/mcd-dispatch-operation-priv.h b/src/mcd-dispatch-operation-priv.h index a8611715..ce168fc3 100644 --- a/src/mcd-dispatch-operation-priv.h +++ b/src/mcd-dispatch-operation-priv.h @@ -69,8 +69,11 @@ G_GNUC_INTERNAL void _mcd_dispatch_operation_approve #define MCD_DISPATCH_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_DISPATCH_OPERATION, McdDispatchOperationClass)) G_GNUC_INTERNAL McdDispatchOperation *_mcd_dispatch_operation_new ( - McdClientRegistry *client_registry, McdHandlerMap *handler_map, - gboolean needs_approval, gboolean observe_only, GList *channels, + McdClientRegistry *client_registry, + McdHandlerMap *handler_map, + gboolean needs_approval, + gboolean observe_only, + McdChannel *channel, const gchar * const *possible_handlers); G_GNUC_INTERNAL gboolean _mcd_dispatch_operation_has_channel ( diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c index d18f3ccd..39a77f82 100644 --- a/src/mcd-dispatch-operation.c +++ b/src/mcd-dispatch-operation.c @@ -1424,8 +1424,8 @@ _mcd_dispatch_operation_init (McdDispatchOperation *operation) * _mcd_dispatch_operation_new: * @client_registry: the client registry. * @handler_map: the handler map - * @channels: a #GList of #McdChannel elements to dispatch. - * @possible_handlers: the bus names of possible handlers for these channels. + * @channel: the channel to dispatch + * @possible_handlers: the bus names of possible handlers for this channel * * Creates a #McdDispatchOperation. */ @@ -1434,7 +1434,7 @@ _mcd_dispatch_operation_new (McdClientRegistry *client_registry, McdHandlerMap *handler_map, gboolean needs_approval, gboolean observe_only, - GList *channels, + McdChannel *channel, const gchar * const *possible_handlers) { gpointer *obj; @@ -1443,14 +1443,12 @@ _mcd_dispatch_operation_new (McdClientRegistry *client_registry, * back", so they can't need approval (i.e. observe_only implies * !needs_approval) */ g_return_val_if_fail (!observe_only || !needs_approval, NULL); - /* exactly one channel */ - g_return_val_if_fail (channels != NULL, NULL); - g_return_val_if_fail (channels->next == NULL, NULL); + g_return_val_if_fail (MCD_IS_CHANNEL (channel), NULL); obj = g_object_new (MCD_TYPE_DISPATCH_OPERATION, "client-registry", client_registry, "handler-map", handler_map, - "channel", channels->data, + "channel", channel, "possible-handlers", possible_handlers, "needs-approval", needs_approval, "observe-only", observe_only, diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c index ce3292d3..c7f3c7a3 100644 --- a/src/mcd-dispatcher.c +++ b/src/mcd-dispatcher.c @@ -246,7 +246,6 @@ _mcd_dispatcher_enter_state_machine (McdDispatcher *dispatcher, McdDispatchOperation *operation; McdDispatcherPrivate *priv; McdAccount *account; - GList *channels; g_return_if_fail (MCD_IS_DISPATCHER (dispatcher)); g_return_if_fail (MCD_IS_CHANNEL (channel)); @@ -266,11 +265,9 @@ _mcd_dispatcher_enter_state_machine (McdDispatcher *dispatcher, channel, mcd_channel_get_object_path (channel)); - channels = g_list_prepend (NULL, channel); operation = _mcd_dispatch_operation_new (priv->clients, - priv->handler_map, !requested, only_observe, channels, + priv->handler_map, !requested, only_observe, channel, (const gchar * const *) possible_handlers); - g_list_free (channels); if (!requested) { |