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:
14
ChangeLog
14
ChangeLog
@@ -1,3 +1,17 @@
|
|||||||
|
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
|
||||||
|
|
||||||
2008-11-20 Dan Williams <dcbw@redhat.com>
|
2008-11-20 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* libnm-util/nm-utils.c
|
* libnm-util/nm-utils.c
|
||||||
|
@@ -232,12 +232,11 @@ static void
|
|||||||
duplicate_setting (NMSetting *setting,
|
duplicate_setting (NMSetting *setting,
|
||||||
const char *name,
|
const char *name,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
gboolean secret,
|
GParamFlags flags,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GObject *dup = (GObject *) user_data;
|
if (flags & G_PARAM_WRITABLE)
|
||||||
|
g_object_set_property (G_OBJECT (user_data), name, value);
|
||||||
g_object_set_property (dup, name, value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -407,9 +406,7 @@ nm_setting_enumerate_values (NMSetting *setting,
|
|||||||
|
|
||||||
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (prop_spec));
|
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (prop_spec));
|
||||||
g_object_get_property (G_OBJECT (setting), prop_spec->name, &value);
|
g_object_get_property (G_OBJECT (setting), prop_spec->name, &value);
|
||||||
func (setting, prop_spec->name, &value,
|
func (setting, prop_spec->name, &value, prop_spec->flags, user_data);
|
||||||
prop_spec->flags & NM_SETTING_PARAM_SECRET,
|
|
||||||
user_data);
|
|
||||||
g_value_unset (&value);
|
g_value_unset (&value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -82,7 +82,7 @@ typedef struct {
|
|||||||
typedef void (*NMSettingValueIterFn) (NMSetting *setting,
|
typedef void (*NMSettingValueIterFn) (NMSetting *setting,
|
||||||
const char *key,
|
const char *key,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
gboolean secret,
|
GParamFlags flags,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -97,12 +97,12 @@ static void
|
|||||||
add_secrets (NMSetting *setting,
|
add_secrets (NMSetting *setting,
|
||||||
const char *key,
|
const char *key,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
gboolean secret,
|
GParamFlags flags,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GHashTable *secrets = user_data;
|
GHashTable *secrets = user_data;
|
||||||
|
|
||||||
if (!secret)
|
if (!(flags & NM_SETTING_PARAM_SECRET))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (G_VALUE_HOLDS_STRING (value)) {
|
if (G_VALUE_HOLDS_STRING (value)) {
|
||||||
|
@@ -346,7 +346,7 @@ static void
|
|||||||
read_one_setting_value (NMSetting *setting,
|
read_one_setting_value (NMSetting *setting,
|
||||||
const char *key,
|
const char *key,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
gboolean secret,
|
GParamFlags flags,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ReadSettingInfo *info = (ReadSettingInfo *) user_data;
|
ReadSettingInfo *info = (ReadSettingInfo *) user_data;
|
||||||
@@ -356,12 +356,16 @@ read_one_setting_value (NMSetting *setting,
|
|||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
gboolean check_for_key = TRUE;
|
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 */
|
/* Setting name gets picked up from the keyfile's section name instead */
|
||||||
if (!strcmp (key, NM_SETTING_NAME))
|
if (!strcmp (key, NM_SETTING_NAME))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Don't read in secrets unless we want to */
|
/* Don't read in secrets unless we want to */
|
||||||
if (secret && !info->secrets)
|
if ((flags & NM_SETTING_PARAM_SECRET) && !info->secrets)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Don't read the NMSettingConnection object's 'read-only' property */
|
/* Don't read the NMSettingConnection object's 'read-only' property */
|
||||||
|
@@ -205,7 +205,7 @@ static void
|
|||||||
write_setting_value (NMSetting *setting,
|
write_setting_value (NMSetting *setting,
|
||||||
const char *key,
|
const char *key,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
gboolean secret,
|
GParamFlags flag,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GKeyFile *file = (GKeyFile *) user_data;
|
GKeyFile *file = (GKeyFile *) user_data;
|
||||||
|
Reference in New Issue
Block a user