Skip to content
  • Philip Withnall's avatar
    gdbusconnection: Support matching object paths with arg0 matching · 96c31741
    Philip Withnall authored
    
    
    GDBus has always supported matching strings with arg0 matching
    (`G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH`). In D-Bus 1.5, support was added
    to the spec for also matching object paths. This got forgotten about and
    was never added to GDBus, meaning that
    `G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH` won’t match against a signal arg0
    of type `o`.
    
    Fix that, and add a unit test.
    
    To do so, we need to add a new `g_dbus_message_get_arg0_path()` API to
    complement the existing `g_dbus_message_get_arg0()` API. The approach of
    letting `g_dbus_message_get_arg0()` return an object-path *or* a string
    would not work, as it’s also called in the implementation of
    `G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE`, which must only match
    string-typed arg0 values and not object-path-typed ones.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@gnome.org>
    
    Fixes: #3183
    96c31741