summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-12-16 15:47:04 +0100
committerThomas Haller <thaller@redhat.com>2015-02-03 13:01:53 +0100
commit83996c621cb7c55d17872fcbd4d2fae51977d839 (patch)
treeb3f0c55ddf6a5a760efa1de01e732ed1e367e0d1
parent64520b7ba4aec12d4750d5351f2bba8317d3fa1b (diff)
downloadNetworkManager-83996c621cb7c55d17872fcbd4d2fae51977d839.tar.gz
config: minor refactoring to highlight mutable property no_auto_default of NMConfig
-rw-r--r--src/nm-config.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nm-config.c b/src/nm-config.c
index 592979aa25..95a75edd9a 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -76,10 +76,13 @@ typedef struct {
char *debug;
- char **no_auto_default;
+ char **no_auto_default_orig;
char **ignore_carrier;
gboolean configure_and_quit;
+
+ /* MUTABLE properties: */
+ char **no_auto_default; /* mutable via merge_no_auto_default_state() */
} NMConfigPrivate;
enum {
@@ -812,12 +815,11 @@ nm_config_new (const NMConfigCmdLineOptions *cli, GError **error)
/* Initialize read only private members */
- priv->no_auto_default = g_key_file_get_string_list (priv->keyfile, "main", "no-auto-default", NULL, NULL);
if (priv->cli.no_auto_default_file)
priv->no_auto_default_file = g_strdup (priv->cli.no_auto_default_file);
else
priv->no_auto_default_file = g_strdup (NM_NO_AUTO_DEFAULT_STATE_FILE);
- merge_no_auto_default_state (self);
+ priv->no_auto_default_orig = g_key_file_get_string_list (priv->keyfile, "main", "no-auto-default", NULL, NULL);
priv->plugins = g_key_file_get_string_list (priv->keyfile, "main", "plugins", NULL, NULL);
if (!priv->plugins)
@@ -852,6 +854,9 @@ nm_config_new (const NMConfigCmdLineOptions *cli, GError **error)
g_free (connectivity_uri);
g_free (connectivity_response);
+ priv->no_auto_default = g_strdupv (priv->no_auto_default_orig);
+ merge_no_auto_default_state (self);
+
return self;
}
@@ -881,6 +886,7 @@ finalize (GObject *gobject)
g_free (priv->log_level);
g_free (priv->log_domains);
g_free (priv->debug);
+ g_strfreev (priv->no_auto_default_orig);
g_strfreev (priv->no_auto_default);
g_strfreev (priv->ignore_carrier);