Commit ff4cb2a1 authored by Thomas Haller's avatar Thomas Haller
Browse files

config: drop nm_config_get_auth_polkit() and access value directly

parent afcfa7be
......@@ -362,7 +362,10 @@ main (int argc, char *argv[])
#endif
);
nm_auth_manager_setup (nm_config_get_auth_polkit (config));
nm_auth_manager_setup (nm_config_data_get_value_boolean (nm_config_get_data_orig (config),
NM_CONFIG_KEYFILE_GROUP_MAIN,
NM_CONFIG_KEYFILE_KEY_MAIN_AUTH_POLKIT,
NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_BOOL));
nm_manager_setup ();
......
......@@ -566,12 +566,12 @@ static struct {
const char *key;
const char *value;
} default_values[] = {
{ NM_CONFIG_KEYFILE_GROUP_MAIN, "plugins", NM_CONFIG_DEFAULT_MAIN_PLUGINS },
{ NM_CONFIG_KEYFILE_GROUP_MAIN, "rc-manager", NM_CONFIG_DEFAULT_MAIN_RC_MANAGER },
{ NM_CONFIG_KEYFILE_GROUP_MAIN, "auth-polkit", NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT },
{ NM_CONFIG_KEYFILE_GROUP_MAIN, "dhcp", NM_CONFIG_DEFAULT_MAIN_DHCP },
{ NM_CONFIG_KEYFILE_GROUP_LOGGING, "backend", NM_CONFIG_DEFAULT_LOGGING_BACKEND },
{ NM_CONFIG_KEYFILE_GROUP_LOGGING, "audit", NM_CONFIG_DEFAULT_LOGGING_AUDIT },
{ NM_CONFIG_KEYFILE_GROUP_MAIN, "plugins", NM_CONFIG_DEFAULT_MAIN_PLUGINS },
{ NM_CONFIG_KEYFILE_GROUP_MAIN, "rc-manager", NM_CONFIG_DEFAULT_MAIN_RC_MANAGER },
{ NM_CONFIG_KEYFILE_GROUP_MAIN, NM_CONFIG_KEYFILE_KEY_MAIN_AUTH_POLKIT, NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT },
{ NM_CONFIG_KEYFILE_GROUP_MAIN, "dhcp", NM_CONFIG_DEFAULT_MAIN_DHCP },
{ NM_CONFIG_KEYFILE_GROUP_LOGGING, "backend", NM_CONFIG_DEFAULT_LOGGING_BACKEND },
{ NM_CONFIG_KEYFILE_GROUP_LOGGING, "audit", NM_CONFIG_DEFAULT_LOGGING_AUDIT },
};
void
......
......@@ -92,7 +92,6 @@ typedef struct {
char *intern_config_file;
gboolean monitor_connection_files;
gboolean auth_polkit;
char *dhcp_client;
char *log_level;
......@@ -267,14 +266,6 @@ nm_config_get_monitor_connection_files (NMConfig *config)
return NM_CONFIG_GET_PRIVATE (config)->monitor_connection_files;
}
gboolean
nm_config_get_auth_polkit (NMConfig *config)
{
g_return_val_if_fail (NM_IS_CONFIG (config), NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_BOOL);
return NM_CONFIG_GET_PRIVATE (config)->auth_polkit;
}
const char *
nm_config_get_dhcp_client (NMConfig *config)
{
......@@ -2331,8 +2322,6 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
priv->monitor_connection_files = nm_config_keyfile_get_boolean (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "monitor-connection-files", FALSE);
priv->auth_polkit = nm_config_keyfile_get_boolean (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "auth-polkit", NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_BOOL);
priv->dhcp_client = nm_strstrip (g_key_file_get_string (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "dhcp", NULL));
priv->log_level = nm_strstrip (g_key_file_get_string (keyfile, NM_CONFIG_KEYFILE_GROUP_LOGGING, "level", NULL));
......@@ -2370,9 +2359,6 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
static void
nm_config_init (NMConfig *config)
{
NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
priv->auth_polkit = NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_BOOL;
}
NMConfig *
......
......@@ -59,6 +59,7 @@
#define NM_CONFIG_KEYFILE_GROUP_IFUPDOWN "ifupdown"
#define NM_CONFIG_KEYFILE_GROUP_IFNET "ifnet"
#define NM_CONFIG_KEYFILE_KEY_MAIN_AUTH_POLKIT "auth-polkit"
#define NM_CONFIG_KEYFILE_KEY_LOGGING_BACKEND "backend"
#define NM_CONFIG_KEYFILE_KEY_CONFIG_ENABLE "enable"
#define NM_CONFIG_KEYFILE_KEY_ATOMIC_SECTION_WAS ".was"
......@@ -115,7 +116,6 @@ NMConfigData *nm_config_get_data_orig (NMConfig *config);
#define NM_CONFIG_GET_DATA_ORIG (nm_config_get_data_orig (nm_config_get ()))
gboolean nm_config_get_monitor_connection_files (NMConfig *config);
gboolean nm_config_get_auth_polkit (NMConfig *config);
const char *nm_config_get_dhcp_client (NMConfig *config);
const char *nm_config_get_log_level (NMConfig *config);
const char *nm_config_get_log_domains (NMConfig *config);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment