mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 12:41:50 +01:00
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:
parent
fe14968c0d
commit
19223803f5
@ -511,10 +511,10 @@ g_application_impl_attempt_primary (GApplicationImpl *impl,
|
||||
if (app_flags & G_APPLICATION_ALLOW_REPLACEMENT)
|
||||
{
|
||||
impl->name_lost_signal = g_dbus_connection_signal_subscribe (impl->session_bus,
|
||||
"org.freedesktop.DBus",
|
||||
"org.freedesktop.DBus",
|
||||
DBUS_SERVICE_DBUS,
|
||||
DBUS_INTERFACE_DBUS,
|
||||
"NameLost",
|
||||
"/org/freedesktop/DBus",
|
||||
DBUS_PATH_DBUS,
|
||||
impl->bus_name,
|
||||
G_DBUS_SIGNAL_FLAGS_NONE,
|
||||
name_lost,
|
||||
|
@ -419,10 +419,10 @@ has_connection (Client *client)
|
||||
* ensure that the user callbacks get called an appropriate number of times. */
|
||||
client->name_lost_subscription_id =
|
||||
g_dbus_connection_signal_subscribe (client->connection,
|
||||
"org.freedesktop.DBus",
|
||||
"org.freedesktop.DBus",
|
||||
DBUS_SERVICE_DBUS,
|
||||
DBUS_INTERFACE_DBUS,
|
||||
"NameLost",
|
||||
"/org/freedesktop/DBus",
|
||||
DBUS_PATH_DBUS,
|
||||
client->name,
|
||||
G_DBUS_SIGNAL_FLAGS_NONE,
|
||||
on_name_lost_or_acquired,
|
||||
@ -430,10 +430,10 @@ has_connection (Client *client)
|
||||
(GDestroyNotify) client_unref);
|
||||
client->name_acquired_subscription_id =
|
||||
g_dbus_connection_signal_subscribe (client->connection,
|
||||
"org.freedesktop.DBus",
|
||||
"org.freedesktop.DBus",
|
||||
DBUS_SERVICE_DBUS,
|
||||
DBUS_INTERFACE_DBUS,
|
||||
"NameAcquired",
|
||||
"/org/freedesktop/DBus",
|
||||
DBUS_PATH_DBUS,
|
||||
client->name,
|
||||
G_DBUS_SIGNAL_FLAGS_NONE,
|
||||
on_name_lost_or_acquired,
|
||||
|
@ -504,10 +504,10 @@ has_connection (Client *client)
|
||||
|
||||
/* start listening to NameOwnerChanged messages immediately */
|
||||
client->name_owner_changed_subscription_id = g_dbus_connection_signal_subscribe (client->connection,
|
||||
"org.freedesktop.DBus", /* name */
|
||||
"org.freedesktop.DBus", /* if */
|
||||
DBUS_SERVICE_DBUS,
|
||||
DBUS_INTERFACE_DBUS,
|
||||
"NameOwnerChanged", /* signal */
|
||||
"/org/freedesktop/DBus", /* path */
|
||||
DBUS_PATH_DBUS,
|
||||
client->name,
|
||||
G_DBUS_SIGNAL_FLAGS_NONE,
|
||||
on_name_owner_changed,
|
||||
|
@ -1719,10 +1719,10 @@ async_initable_init_first (GAsyncInitable *initable)
|
||||
{
|
||||
proxy->priv->name_owner_changed_subscription_id =
|
||||
g_dbus_connection_signal_subscribe (proxy->priv->connection,
|
||||
"org.freedesktop.DBus", /* name */
|
||||
"org.freedesktop.DBus", /* interface */
|
||||
DBUS_SERVICE_DBUS,
|
||||
DBUS_INTERFACE_DBUS,
|
||||
"NameOwnerChanged", /* signal name */
|
||||
"/org/freedesktop/DBus", /* path */
|
||||
DBUS_PATH_DBUS,
|
||||
proxy->priv->name, /* arg0 */
|
||||
signal_flags,
|
||||
on_name_owner_changed,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user