summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-08-24 14:44:43 +0200
committerThomas Haller <thaller@redhat.com>2018-09-05 11:41:40 +0200
commitb8beb4e22b650f26bbf8b6c3676ffb05fe46dc19 (patch)
treeb4228b57bacbb35a5c5fe2cf70f3982cd94163e3
parenta068f0ca2624b433850ace9ca7bcbe635b6c85df (diff)
downloadNetworkManager-b8beb4e22b650f26bbf8b6c3676ffb05fe46dc19.tar.gz
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.
-rw-r--r--src/settings/nm-settings.c32
1 files changed, 1 insertions, 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) {