2008-11-20 Dan Williams <dcbw@redhat.com>

Patch from Tambet Ingo <tambet@gmail.com>

	* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- (NMSettingValueIterFn): instead of just a gboolean for secrets, take
			all the GParamSpec flags of the property

	* system-settings/plugins/keyfile/nm-keyfile-connection.c
	  system-settings/plugins/keyfile/reader.c
	  system-settings/plugins/keyfile/writer.c
		- Update for NMSettingValueIterFn change



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4322 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2008-11-20 21:23:55 +00:00
parent 1f5394567d
commit 93f1c85b26
6 changed files with 40 additions and 25 deletions

View File

@@ -97,12 +97,12 @@ static void
add_secrets (NMSetting *setting,
const char *key,
const GValue *value,
gboolean secret,
GParamFlags flags,
gpointer user_data)
{
GHashTable *secrets = user_data;
if (!secret)
if (!(flags & NM_SETTING_PARAM_SECRET))
return;
if (G_VALUE_HOLDS_STRING (value)) {

View File

@@ -344,10 +344,10 @@ typedef struct {
static void
read_one_setting_value (NMSetting *setting,
const char *key,
const GValue *value,
gboolean secret,
gpointer user_data)
const char *key,
const GValue *value,
GParamFlags flags,
gpointer user_data)
{
ReadSettingInfo *info = (ReadSettingInfo *) user_data;
GKeyFile *file = info->keyfile;
@@ -356,12 +356,16 @@ read_one_setting_value (NMSetting *setting,
GError *err = NULL;
gboolean check_for_key = TRUE;
/* Property is not writable */
if (!(flags & G_PARAM_WRITABLE))
return;
/* Setting name gets picked up from the keyfile's section name instead */
if (!strcmp (key, NM_SETTING_NAME))
return;
/* Don't read in secrets unless we want to */
if (secret && !info->secrets)
if ((flags & NM_SETTING_PARAM_SECRET) && !info->secrets)
return;
/* Don't read the NMSettingConnection object's 'read-only' property */

View File

@@ -203,10 +203,10 @@ write_hash_of_string (GKeyFile *file,
static void
write_setting_value (NMSetting *setting,
const char *key,
const GValue *value,
gboolean secret,
gpointer user_data)
const char *key,
const GValue *value,
GParamFlags flag,
gpointer user_data)
{
GKeyFile *file = (GKeyFile *) user_data;
const char *setting_name;