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.
This commit is contained in:
Thomas Haller 2019-05-05 09:37:37 +02:00
parent 143b6e41af
commit 1e01c5fec9
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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.
*