diff --git a/src/nm-config.c b/src/nm-config.c index 25e4902bde..c7e61b559e 100644 --- a/src/nm-config.c +++ b/src/nm-config.c @@ -107,11 +107,11 @@ static void _set_config_data (NMConfig *self, NMConfigData *new_data); /************************************************************************/ -static gboolean -_get_bool_value (GKeyFile *keyfile, - const char *section, - const char *key, - gboolean default_value) +gboolean +nm_config_keyfile_get_boolean (GKeyFile *keyfile, + const char *section, + const char *key, + gboolean default_value) { gboolean value = default_value; char *str; @@ -828,9 +828,9 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error) if (!priv->plugins) priv->plugins = g_new0 (char *, 1); - priv->monitor_connection_files = _get_bool_value (keyfile, "main", "monitor-connection-files", FALSE); + priv->monitor_connection_files = nm_config_keyfile_get_boolean (keyfile, "main", "monitor-connection-files", FALSE); - priv->auth_polkit = _get_bool_value (keyfile, "main", "auth-polkit", NM_CONFIG_DEFAULT_AUTH_POLKIT); + priv->auth_polkit = nm_config_keyfile_get_boolean (keyfile, "main", "auth-polkit", NM_CONFIG_DEFAULT_AUTH_POLKIT); priv->dhcp_client = g_key_file_get_value (keyfile, "main", "dhcp", NULL); @@ -839,7 +839,7 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error) priv->debug = g_key_file_get_value (keyfile, "main", "debug", NULL); - priv->configure_and_quit = _get_bool_value (keyfile, "main", "configure-and-quit", FALSE); + priv->configure_and_quit = nm_config_keyfile_get_boolean (keyfile, "main", "configure-and-quit", FALSE); no_auto_default_orig_list = nm_config_get_device_match_spec (keyfile, "main", "no-auto-default"); diff --git a/src/nm-config.h b/src/nm-config.h index e72132af9d..29d6566323 100644 --- a/src/nm-config.h +++ b/src/nm-config.h @@ -89,6 +89,10 @@ NMConfig *nm_config_setup (const NMConfigCmdLineOptions *cli, GError **error); void nm_config_reload (NMConfig *config); GKeyFile *nm_config_create_keyfile (void); +gboolean nm_config_keyfile_get_boolean (GKeyFile *keyfile, + const char *section, + const char *key, + gboolean default_value); GSList *nm_config_get_device_match_spec (const GKeyFile *keyfile, const char *group, const char *key); G_END_DECLS