diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-01-31 15:55:53 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-06-24 16:00:13 +0100 |
commit | 85e9a283035b935c147408f88fb8dd8fcc225edf (patch) | |
tree | c05499599477a42e38150a582ddee769d129d237 /bus/signals.c | |
parent | 16b96009641749c600af28245f7f6f92bd53dcb8 (diff) | |
download | dbus-85e9a283035b935c147408f88fb8dd8fcc225edf.tar.gz |
match_rule_to_string: don't reinvent dbus_message_type_to_string
We don't allow match rules with unknown message types, so losing the
"type='%d'" case isn't a great loss.
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040
Diffstat (limited to 'bus/signals.c')
-rw-r--r-- | bus/signals.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/bus/signals.c b/bus/signals.c index 4d34ca14..62881b57 100644 --- a/bus/signals.c +++ b/bus/signals.c @@ -138,36 +138,9 @@ match_rule_to_string (BusMatchRule *rule) if (rule->flags & BUS_MATCH_MESSAGE_TYPE) { - if (rule->message_type == DBUS_MESSAGE_TYPE_INVALID) - { - if (!_dbus_string_append_printf (&str, "type='INVALID'")) - goto nomem; - } - else if (rule->message_type == DBUS_MESSAGE_TYPE_METHOD_CALL) - { - if (!_dbus_string_append_printf (&str, "type='method_call'")) - goto nomem; - } - else if (rule->message_type == DBUS_MESSAGE_TYPE_METHOD_RETURN) - { - if (!_dbus_string_append_printf (&str, "type='method_return'")) - goto nomem; - } - else if (rule->message_type == DBUS_MESSAGE_TYPE_ERROR) - { - if (!_dbus_string_append_printf (&str, "type='error'")) - goto nomem; - } - else if (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL) - { - if (!_dbus_string_append_printf (&str, "type='signal'")) - goto nomem; - } - else - { - if (!_dbus_string_append_printf (&str, "type='%d'", rule->message_type)) - goto nomem; - } + if (!_dbus_string_append_printf (&str, "type='%s'", + dbus_message_type_to_string (rule->message_type))) + goto nomem; } if (rule->flags & BUS_MATCH_INTERFACE) |