diff options
author | Mark McLoughlin <mark@skynet.ie> | 2004-04-02 18:02:41 +0000 |
---|---|---|
committer | Mark McLoughlin <markmc@src.gnome.org> | 2004-04-02 18:02:41 +0000 |
commit | 5862e095d0a24cabdde734e04bf473baf5fa35d5 (patch) | |
tree | 8df860de72a34f1b4cbf1477ceee37e952368b35 | |
parent | 86f8434091eb8a7e0f76e0ebda3eb0bb73e9b28f (diff) | |
download | gconf-5862e095d0a24cabdde734e04bf473baf5fa35d5.tar.gz |
handle an <entry> with only a <schema_name> correctly.
2004-04-02 Mark McLoughlin <mark@skynet.ie>
* gconf/gconftool.c: (set_values), (process_entry): handle
an <entry> with only a <schema_name> correctly.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gconf/gconftool.c | 29 |
2 files changed, 20 insertions, 14 deletions
@@ -1,3 +1,8 @@ +2004-04-02 Mark McLoughlin <mark@skynet.ie> + + * gconf/gconftool.c: (set_values), (process_entry): handle + an <entry> with only a <schema_name> correctly. + 2004-04-01 Mark McLoughlin <mark@skynet.ie> * gconf/gconftool.c: (dump_entries_in_dir): don't dump diff --git a/gconf/gconftool.c b/gconf/gconftool.c index ad1e5f1b..9e13e83c 100644 --- a/gconf/gconftool.c +++ b/gconf/gconftool.c @@ -2764,7 +2764,6 @@ set_values(GConfEngine* conf, const gchar* base_dir, const gchar* key, const cha { GSList* tmp; gchar* full_key; - gchar* full_schema_key; if (base_dir) full_key = gconf_concat_dir_and_key(base_dir, key); @@ -2773,23 +2772,17 @@ set_values(GConfEngine* conf, const gchar* base_dir, const gchar* key, const cha if (schema_key) { + gchar* full_schema_key; + if (base_dir && *schema_key != '/') full_schema_key = gconf_concat_dir_and_key(base_dir, schema_key); else full_schema_key = g_strdup(schema_key); - } - else - full_schema_key = NULL; - - tmp = values; - while (tmp) - { - GConfValue* value = tmp->data; - GError* error; if (full_schema_key) { - error = NULL; + GError* error = NULL; + if (!gconf_engine_associate_schema(conf, full_key, full_schema_key, &error)) { g_assert(error != NULL); @@ -2798,7 +2791,16 @@ set_values(GConfEngine* conf, const gchar* base_dir, const gchar* key, const cha full_schema_key, full_key, error->message); g_error_free(error); } - } + + g_free(full_schema_key); + } + } + + tmp = values; + while (tmp) + { + GConfValue* value = tmp->data; + GError* error; error = NULL; gconf_engine_set(conf, full_key, value, &error); @@ -2812,7 +2814,6 @@ set_values(GConfEngine* conf, const gchar* base_dir, const gchar* key, const cha tmp = tmp->next; } - g_free(full_schema_key); g_free(full_key); } @@ -2841,7 +2842,7 @@ process_entry(GConfEngine* conf, xmlNodePtr node, const gchar** base_dirs, const iter = iter->next; } - if (key && values) + if (key && (values || schema_key)) { if (!base_dirs) set_values(conf, orig_base, key, schema_key, values); |