From 2db920659f98cd2abcbe1f724d9c6b002cb58024 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 17 Nov 2011 23:14:10 -0600 Subject: [PATCH] core: move nm_device_interface_connection_match_config() to nm-device.c --- src/nm-device-interface.c | 11 ----------- src/nm-device-interface.h | 5 ----- src/nm-device.c | 7 +++---- src/nm-device.h | 3 +++ src/nm-manager.c | 3 +-- 5 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c index ddc57ec529..8dfbfb8dea 100644 --- a/src/nm-device-interface.c +++ b/src/nm-device-interface.c @@ -370,17 +370,6 @@ nm_device_interface_spec_match_list (NMDeviceInterface *device, return FALSE; } -NMConnection * -nm_device_interface_connection_match_config (NMDeviceInterface *device, - const GSList *connections) -{ - g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), NULL); - - if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->connection_match_config) - return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->connection_match_config (device, connections); - return NULL; -} - void nm_device_interface_set_enabled (NMDeviceInterface *device, gboolean enabled) { diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index 5fe754696a..f642824dfd 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -102,8 +102,6 @@ struct _NMDeviceInterface { gboolean (*spec_match_list) (NMDeviceInterface *device, const GSList *specs); - NMConnection * (*connection_match_config) (NMDeviceInterface *device, const GSList *specs); - void (*set_enabled) (NMDeviceInterface *device, gboolean enabled); gboolean (*get_enabled) (NMDeviceInterface *device); @@ -131,9 +129,6 @@ void nm_device_interface_deactivate (NMDeviceInterface *device, NMDeviceStateRea gboolean nm_device_interface_spec_match_list (NMDeviceInterface *device, const GSList *specs); -NMConnection * nm_device_interface_connection_match_config (NMDeviceInterface *device, - const GSList *connections); - gboolean nm_device_interface_get_enabled (NMDeviceInterface *device); void nm_device_interface_set_enabled (NMDeviceInterface *device, gboolean enabled); diff --git a/src/nm-device.c b/src/nm-device.c index 5acaa90ca0..396cbbeb18 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -174,7 +174,6 @@ static gboolean nm_device_activate (NMDeviceInterface *device, static void nm_device_deactivate (NMDeviceInterface *device, NMDeviceStateReason reason); static gboolean device_disconnect (NMDeviceInterface *device, GError **error); static gboolean spec_match_list (NMDeviceInterface *device, const GSList *specs); -static NMConnection *connection_match_config (NMDeviceInterface *device, const GSList *connections); static void nm_device_take_down (NMDevice *dev, gboolean wait, NMDeviceStateReason reason); @@ -205,7 +204,6 @@ device_interface_init (NMDeviceInterface *device_interface_class) device_interface_class->deactivate = nm_device_deactivate; device_interface_class->disconnect = device_disconnect; device_interface_class->spec_match_list = spec_match_list; - device_interface_class->connection_match_config = connection_match_config; } @@ -4055,10 +4053,11 @@ spec_match_list (NMDeviceInterface *device, const GSList *specs) return FALSE; } -static NMConnection * -connection_match_config (NMDeviceInterface *device, const GSList *connections) +NMConnection * +nm_device_connection_match_config (NMDevice *device, const GSList *connections) { g_return_val_if_fail (device != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); if (NM_DEVICE_GET_CLASS (device)->connection_match_config) return NM_DEVICE_GET_CLASS (device)->connection_match_config (NM_DEVICE (device), connections); diff --git a/src/nm-device.h b/src/nm-device.h index 36b07f96a1..bf899b2ef4 100644 --- a/src/nm-device.h +++ b/src/nm-device.h @@ -162,6 +162,9 @@ gboolean nm_device_check_connection_compatible (NMDevice *device, gboolean nm_device_can_assume_connections (NMDevice *device); +NMConnection * nm_device_connection_match_config (NMDevice *device, + const GSList *connections); + gboolean nm_device_is_activating (NMDevice *dev); gboolean nm_device_can_interrupt_activation (NMDevice *self); gboolean nm_device_autoconnect_allowed (NMDevice *self); diff --git a/src/nm-manager.c b/src/nm-manager.c index 15dd4d87f6..f54cfc4543 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1567,8 +1567,7 @@ add_device (NMManager *self, NMDevice *device) GSList *connections = NULL; connections = nm_settings_get_connections (priv->settings); - existing = nm_device_interface_connection_match_config (NM_DEVICE_INTERFACE (device), - (const GSList *) connections); + existing = nm_device_connection_match_config (device, (const GSList *) connections); g_slist_free (connections); if (existing)