gdbus: Use symbolic constants to subscribe to message bus signals

Unlike the various functions to call D-Bus methods, these sort their
arguments in a non-obvious order (bus name, interface, signal, path),
presumably aiming to sort the most-likely-to-be-used arguments first.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2024-05-13 12:45:29 +01:00
committed by Philip Withnall
parent fe14968c0d
commit 19223803f5
5 changed files with 24 additions and 24 deletions

View File

@@ -214,10 +214,10 @@ test_connection_life_cycle (void)
/* signal registration */
g_atomic_int_set (&on_signal_registration_freed_called, FALSE);
g_dbus_connection_signal_subscribe (c2,
"org.freedesktop.DBus", /* bus name */
"org.freedesktop.DBus", /* interface */
DBUS_SERVICE_DBUS,
DBUS_INTERFACE_DBUS,
"NameOwnerChanged", /* member */
"/org/freedesktop/DBus", /* path */
DBUS_PATH_DBUS,
NULL, /* arg0 */
G_DBUS_SIGNAL_FLAGS_NONE,
on_name_owner_changed,
@@ -619,10 +619,10 @@ test_connection_signals (void)
&count_s2,
NULL);
s3 = g_dbus_connection_signal_subscribe (c1,
"org.freedesktop.DBus", /* sender */
"org.freedesktop.DBus", /* interface */
DBUS_SERVICE_DBUS,
DBUS_INTERFACE_DBUS,
"NameOwnerChanged", /* member */
"/org/freedesktop/DBus", /* path */
DBUS_PATH_DBUS,
NULL,
G_DBUS_SIGNAL_FLAGS_NONE,
test_connection_signal_handler,
@@ -1115,10 +1115,10 @@ test_connection_filter (void)
/* wait for service to be available */
signal_handler_id = g_dbus_connection_signal_subscribe (c,
"org.freedesktop.DBus", /* sender */
"org.freedesktop.DBus",
DBUS_SERVICE_DBUS,
DBUS_INTERFACE_DBUS,
"NameOwnerChanged",
"/org/freedesktop/DBus",
DBUS_PATH_DBUS,
NULL, /* arg0 */
G_DBUS_SIGNAL_FLAGS_NONE,
test_connection_filter_name_owner_changed_signal_handler,