aboutsummaryrefslogtreecommitdiffstats
path: root/storage_xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage_xml.c')
-rw-r--r--storage_xml.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/storage_xml.c b/storage_xml.c
index 107983cf..dbdd151d 100644
--- a/storage_xml.c
+++ b/storage_xml.c
@@ -64,9 +64,11 @@ static void xml_init(void)
static void handle_settings(struct xt_node *node, set_t **head)
{
struct xt_node *c;
+ struct set *s;
for (c = node->children; (c = xt_find_node(c, "setting")); c = c->next) {
char *name = xt_find_attr(c, "name");
+ char *locked = xt_find_attr(c, "locked");
if (!name) {
continue;
@@ -79,6 +81,12 @@ static void handle_settings(struct xt_node *node, set_t **head)
}
}
set_setstr(head, name, c->text);
+ if (locked && !g_strcasecmp(locked, "true")) {
+ s = set_find(head, name);
+ if (s) {
+ s->flags |= SET_LOCKED;
+ }
+ }
}
}
@@ -370,6 +378,9 @@ static void xml_generate_settings(struct xt_node *cur, set_t **head)
struct xt_node *xset;
xt_add_child(cur, xset = xt_new_node("setting", set->value, NULL));
xt_add_attr(xset, "name", set->key);
+ if (set->flags & SET_LOCKED) {
+ xt_add_attr(xset, "locked", "true");
+ }
}
}
}