From 32442b2661305ae2b99177d516aec18450f2b6ed Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 24 Aug 2018 14:44:43 +0200 Subject: [PATCH] settings: drop unused get_plugin() checks Nowadays, keyfile settings plugin is always loaded. Hence, this function never returns %NULL and the checks always evalute the the same. --- src/settings/nm-settings.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index 8c6d67e5ab..1cc64e6cc3 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -526,28 +526,6 @@ nm_settings_get_unmanaged_specs (NMSettings *self) return priv->unmanaged_specs; } -static NMSettingsPlugin * -get_plugin (NMSettings *self, gboolean has_add_connection) -{ - NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self); - GSList *iter; - - g_return_val_if_fail (self != NULL, NULL); - - /* Do any of the plugins support the given capability? */ - for (iter = priv->plugins; iter; iter = iter->next) { - NMSettingsPlugin *plugin = NM_SETTINGS_PLUGIN (iter->data); - - if (!has_add_connection) - return plugin; - - if (NM_SETTINGS_PLUGIN_GET_INTERFACE (iter->data)->add_connection != NULL) - return plugin; - } - - return NULL; -} - static gboolean find_spec (GSList *spec_list, const char *spec) { @@ -1297,14 +1275,6 @@ nm_settings_add_connection_dbus (NMSettings *self, goto done; } - /* Do any of the plugins support adding? */ - if (!get_plugin (self, TRUE)) { - error = g_error_new_literal (NM_SETTINGS_ERROR, - NM_SETTINGS_ERROR_NOT_SUPPORTED, - "None of the registered plugins support add."); - goto done; - } - if (!nm_auth_is_subject_in_acl_set_error (connection, subject, NM_SETTINGS_ERROR, @@ -1884,7 +1854,7 @@ get_property (GObject *object, guint prop_id, : NULL); break; case PROP_CAN_MODIFY: - g_value_set_boolean (value, !!get_plugin (self, TRUE)); + g_value_set_boolean (value, TRUE); break; case PROP_CONNECTIONS: if (priv->connections_loaded) {