diff options
author | Thomas Haller <thaller@redhat.com> | 2016-11-25 13:54:42 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-11-25 15:26:30 +0100 |
commit | 6689d0bf7184b22b01550e1db997e93d089cf99d (patch) | |
tree | 41b36a36c43f4eec06aebe793c88a96d320727a4 /src/settings/nm-settings.c | |
parent | 544f7d36838b46826098e1d2711e299a802380d1 (diff) | |
download | NetworkManager-6689d0bf7184b22b01550e1db997e93d089cf99d.tar.gz |
config: optionally let nm_config_get_plugins() return compile time default
Instead of having the caller do the fallback to the compile time default
plugins, let it be handled by nm_config_get_plugins().
The knowledge of fallback to a compile time default (and how to do that
properly) should be inside NMConfig/NMConfigData alone.
Also, as this function is only called once, let NMConfig not cache
the string list but create it once as needed.
Diffstat (limited to 'src/settings/nm-settings.c')
-rw-r--r-- | src/settings/nm-settings.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index dd82cf9703..6a920d5cf4 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -2284,19 +2284,14 @@ nm_settings_start (NMSettings *self, GError **error) GDBusProxy *proxy; GVariant *variant; GError *local_error = NULL; - const char **plugins; - gs_strfreev char **plugins_default = NULL; + gs_strfreev char **plugins = NULL; priv = NM_SETTINGS_GET_PRIVATE (self); /* Load the plugins; fail if a plugin is not found. */ - plugins = nm_config_get_plugins (priv->config); - if (!plugins) { - plugins_default = g_strsplit (NM_CONFIG_PLUGINS_DEFAULT, ",", -1); - plugins = (const char **) plugins_default; - } + plugins = nm_config_data_get_plugins (nm_config_get_data_orig (priv->config), TRUE); - if (!load_plugins (self, plugins, error)) { + if (!load_plugins (self, (const char **) plugins, error)) { g_object_unref (self); return FALSE; } |