[Libreoffice-commits] core.git: configmgr/source

Stephan Bergmann sbergman at redhat.com
Fri Aug 21 04:27:59 PDT 2015


 configmgr/source/readdconflayer.cxx |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 67169b65d0ffb8c44f84b483618c285bf17a6b54
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Aug 21 13:27:17 2015 +0200

    Support "finalized" in dconf layer
    
    Change-Id: Id33e21b01d8898ea9ff49bc7cc59b573580ab88d

diff --git a/configmgr/source/readdconflayer.cxx b/configmgr/source/readdconflayer.cxx
index 62e6a65..d6575e7 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:


More information about the Libreoffice-commits mailing list