summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-08-21 13:27:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-08-21 13:27:17 +0200
commit67169b65d0ffb8c44f84b483618c285bf17a6b54 (patch)
tree4c728354e0233f01bb09a42e7d16ca62533f4506 /configmgr
parentae0cd13fa3b4468997aa66ae569f724e8fbbd372 (diff)
Support "finalized" in dconf layer
Change-Id: Id33e21b01d8898ea9ff49bc7cc59b573580ab88d
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/readdconflayer.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/configmgr/source/readdconflayer.cxx b/configmgr/source/readdconflayer.cxx
index 62e6a65912a6..d6575e782007 100644
--- a/configmgr/source/readdconflayer.cxx
+++ b/configmgr/source/readdconflayer.cxx
@@ -87,7 +87,13 @@
//
// ** Nillable values recursively map to GVariant maybe instances.
//
-// TODO: support "finalized", "mandatory", and "external"?
+// Finalization: The component-update.dtd allows for finalization of
+// oor:component-data, node, and prop elements, while dconf allows for locking
+// of individual keys. That does not match, but just mark the individual Node
+// instances that correspond to individual dconf keys as finalized for
+// non-writable dconf keys.
+//
+// TODO: support "mandatory" and "external"?
namespace configmgr {
@@ -682,6 +688,15 @@ ReadValue readValue(
return ReadValue::Value;
}
+void finalize(
+ GObjectHolder<DConfClient> const & client, OString const & path,
+ rtl::Reference<Node> & node, int layer)
+{
+ if (!dconf_client_is_writable(client.get(), path.getStr())) {
+ node->setFinalized(layer);
+ }
+}
+
void readDir(
Data & data, int layer, rtl::Reference<Node> const & node,
NodeMap & members, GObjectHolder<DConfClient> const & client,
@@ -855,6 +870,7 @@ void readDir(
continue;
case ReadValue::Value:
prop->setValue(layer, value);
+ finalize(client, path, member, layer);
break;
case ReadValue::Remove:
remove = true;
@@ -885,6 +901,7 @@ void readDir(
}
static_cast<LocalizedValueNode *>(member.get())->setValue(
layer, value);
+ finalize(client, path, member, layer);
break;
}
case Node::KIND_LOCALIZED_PROPERTY: