From 4aba7d46968fa442f34abb6e7caed43e7f242e7b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 3 May 2019 16:45:59 +0200 Subject: [PATCH] core: use NM_SETTINGS_GET for singlton instead of nm_settings_get() We have it, so use it. Also, we use a similar macro for other singletons. --- src/devices/wifi/nm-iwd-manager.c | 2 +- src/nm-checkpoint.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/devices/wifi/nm-iwd-manager.c b/src/devices/wifi/nm-iwd-manager.c index 494fca321f..3f973090f3 100644 --- a/src/devices/wifi/nm-iwd-manager.c +++ b/src/devices/wifi/nm-iwd-manager.c @@ -900,7 +900,7 @@ nm_iwd_manager_init (NMIwdManager *self) g_signal_connect (priv->manager, NM_MANAGER_DEVICE_ADDED, G_CALLBACK (device_added), self); - priv->settings = g_object_ref (nm_settings_get ()); + priv->settings = g_object_ref (NM_SETTINGS_GET); g_signal_connect (priv->settings, NM_SETTINGS_SIGNAL_CONNECTION_REMOVED, G_CALLBACK (connection_removed), self); diff --git a/src/nm-checkpoint.c b/src/nm-checkpoint.c index f715eea611..3a1693d26e 100644 --- a/src/nm-checkpoint.c +++ b/src/nm-checkpoint.c @@ -171,7 +171,7 @@ find_settings_connection (NMCheckpoint *self, *need_update = FALSE; uuid = nm_connection_get_uuid (dev_checkpoint->settings_connection); - sett_conn = nm_settings_get_connection_by_uuid (nm_settings_get (), uuid); + sett_conn = nm_settings_get_connection_by_uuid (NM_SETTINGS_GET, uuid); if (!sett_conn) return NULL; @@ -239,7 +239,7 @@ restore_and_activate_connection (NMCheckpoint *self, _LOGD ("rollback: adding connection %s again", nm_connection_get_uuid (dev_checkpoint->settings_connection)); - connection = nm_settings_add_connection (nm_settings_get (), + connection = nm_settings_add_connection (NM_SETTINGS_GET, dev_checkpoint->settings_connection, TRUE, &local_error); @@ -419,7 +419,7 @@ next_dev: gs_free NMSettingsConnection **list = NULL; g_return_val_if_fail (priv->connection_uuids, NULL); - list = nm_settings_get_connections_clone (nm_settings_get (), NULL, + list = nm_settings_get_connections_clone (NM_SETTINGS_GET, NULL, NULL, NULL, nm_settings_connection_cmp_autoconnect_priority_p_with_data, NULL); @@ -687,7 +687,7 @@ nm_checkpoint_new (NMManager *manager, GPtrArray *devices, guint32 rollback_time if (NM_FLAGS_HAS (flags, NM_CHECKPOINT_CREATE_FLAG_DELETE_NEW_CONNECTIONS)) { priv->connection_uuids = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, NULL); - for (con = nm_settings_get_connections (nm_settings_get (), NULL); *con; con++) { + for (con = nm_settings_get_connections (NM_SETTINGS_GET, NULL); *con; con++) { g_hash_table_add (priv->connection_uuids, g_strdup (nm_settings_connection_get_uuid (*con))); }