From 1e01c5fec908f65a9b670a49efa46f04fc40ae3e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 5 May 2019 09:37:37 +0200 Subject: [PATCH] core: use NM_MAIN_DBUS_CONNECTION_GET macro We will use the D-Bus connection of our NMDBusManager singleton more. Use a macro. - it's shorter to type and it's one distinct word. - the name indicates what this is: the main D-Bus connection singleton. By searching for this name we can find all users that care about using this singleton. --- src/dns/nm-dns-systemd-resolved.c | 2 +- src/nm-connectivity.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dns/nm-dns-systemd-resolved.c b/src/dns/nm-dns-systemd-resolved.c index 5d262ba3c7..27f106b763 100644 --- a/src/dns/nm-dns-systemd-resolved.c +++ b/src/dns/nm-dns-systemd-resolved.c @@ -527,7 +527,7 @@ nm_dns_systemd_resolved_init (NMDnsSystemdResolved *self) c_list_init (&priv->request_queue_lst_head); - priv->dbus_connection = nm_g_object_ref (nm_dbus_manager_get_dbus_connection (nm_dbus_manager_get ())); + priv->dbus_connection = nm_g_object_ref (NM_MAIN_DBUS_CONNECTION_GET); if (!priv->dbus_connection) { _LOGD ("no D-Bus connection"); return; diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c index de3d8b4dff..a842a4cda7 100644 --- a/src/nm-connectivity.c +++ b/src/nm-connectivity.c @@ -863,7 +863,7 @@ nm_connectivity_check_start (NMConnectivity *self, if (has_systemd_resolved) { GDBusConnection *dbus_connection; - dbus_connection = nm_dbus_manager_get_dbus_connection (nm_dbus_manager_get ()); + dbus_connection = NM_MAIN_DBUS_CONNECTION_GET; if (!dbus_connection) { /* we have no D-Bus connection? That might happen in configure and quit mode. *