diff options
Diffstat (limited to 'src/settings/plugins/ifnet/plugin.c')
-rw-r--r-- | src/settings/plugins/ifnet/plugin.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/settings/plugins/ifnet/plugin.c b/src/settings/plugins/ifnet/plugin.c index 7f1eb4ff93..5eab31abfd 100644 --- a/src/settings/plugins/ifnet/plugin.c +++ b/src/settings/plugins/ifnet/plugin.c @@ -47,7 +47,6 @@ #define IFNET_PLUGIN_INFO "(C) 1999-2010 Gentoo Foundation, Inc. To report bugs please use bugs.gentoo.org with [networkmanager] or [qiaomuf] prefix." #define IFNET_SYSTEM_HOSTNAME_FILE "/etc/conf.d/hostname" #define IFNET_MANAGE_WELL_KNOWN_DEFAULT TRUE -#define IFNET_KEY_FILE_KEY_MANAGED "managed" typedef struct { GHashTable *connections; /* uuid::connection */ @@ -121,17 +120,9 @@ write_system_hostname (NMSystemConfigInterface * config, static gboolean is_managed_plugin (void) { - char *result = NULL; - - result = nm_config_data_get_value (nm_config_get_data_orig (nm_config_get ()), - IFNET_KEY_FILE_GROUP, IFNET_KEY_FILE_KEY_MANAGED, - NULL); - if (result) { - gboolean ret = is_true (result); - g_free (result); - return ret; - } - return IFNET_MANAGE_WELL_KNOWN_DEFAULT; + return nm_config_data_get_value_boolean (NM_CONFIG_GET_DATA_ORIG, + NM_CONFIG_KEYFILE_GROUP_IFNET, NM_CONFIG_KEYFILE_KEY_IFNET_MANAGED, + IFNET_MANAGE_WELL_KNOWN_DEFAULT); } static void @@ -246,8 +237,7 @@ reload_connections (NMSystemConfigInterface *config) SCPluginIfnet *self = SC_PLUGIN_IFNET (config); SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (self); GList *conn_names = NULL, *n_iter = NULL; - gboolean auto_refresh = FALSE; - char *str_auto_refresh; + gboolean auto_refresh; GError *error = NULL; /* save names for removing unused connections */ @@ -264,12 +254,9 @@ reload_connections (NMSystemConfigInterface *config) nm_log_info (LOGD_SETTINGS, "Loading connections"); - str_auto_refresh = nm_config_data_get_value (nm_config_get_data_orig (nm_config_get ()), - IFNET_KEY_FILE_GROUP, "auto_refresh", - NULL); - if (str_auto_refresh && is_true (str_auto_refresh)) - auto_refresh = TRUE; - g_free (str_auto_refresh); + auto_refresh = nm_config_data_get_value_boolean (NM_CONFIG_GET_DATA_ORIG, + NM_CONFIG_KEYFILE_GROUP_IFNET, NM_CONFIG_KEYFILE_KEY_IFNET_AUTO_REFRESH, + FALSE); new_connections = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref); |