summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-09-02 16:55:45 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-09-02 17:06:40 +0200
commitec7329f6353ada02d8d02dd7607b2c06d097e8a5 (patch)
tree438b8abd59dea87fc83020d0e1437fe0dd1283ab /configmgr
parent998c64eaad98639654535229faf0e499336852d9 (diff)
configmgr: Split dconf in two /org/libreoffice/registry/{system,user}/
...so that the lower-layer "dconf:*" reads from the .../system/ dconf tree while the final-layer "dconf:!" reads from and writes to the .../user/ dconf tree. Using a single tree would not really work: For one, a sysadmin will want to finalize a property so it cannot be changed by extensions; that means that property must be set and finalized in the lower-layer "dconf:*". But for another, a user will want to change a property for which an extension provides a value; that means that property must be set in the final-layer "dconf:!". So the two "dconf:*" and "dconf:!" must store their respective data in different places. Change-Id: I9029e7f779bcb86e8f26cfc22401e97e0cb3362b
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/components.cxx3
-rw-r--r--configmgr/source/dconf.cxx12
-rw-r--r--configmgr/source/dconf.hxx2
3 files changed, 11 insertions, 6 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index a51c5ac8515a..ca0894015935 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -537,8 +537,9 @@ Components::Components(
} else if (type == "dconf") {
if (url == "!") {
modificationTarget_ = ModificationTarget::Dconf;
+ dconf::readLayer(data_, Data::NO_LAYER, false);
} else if (url == "*") {
- dconf::readLayer(data_, layer);
+ dconf::readLayer(data_, layer, true);
} else {
throw css::uno::RuntimeException(
"CONFIGURATION_LAYERS: unknown \"dconf\" kind \"" + url
diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index ce871a343268..7c69eb543bda 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -216,6 +216,11 @@ private:
DConfChangeset * changeset_;
};
+OString getRoot(bool system) {
+ return "/org/libreoffice/registry/"
+ + (system ? OStringLiteral("system") : OStringLiteral("user"));
+}
+
bool decode(OUString * string, bool slash) {
for (sal_Int32 i = 0;; ++i) {
i = string->indexOf('\\', i);
@@ -1544,7 +1549,7 @@ bool addModifications(
}
-void readLayer(Data & data, int layer) {
+void readLayer(Data & data, int layer, bool system) {
GObjectHolder<DConfClient> client(dconf_client_new());
if (client.get() == nullptr) {
SAL_WARN("configmgr.dconf", "dconf_client_new failed");
@@ -1552,7 +1557,7 @@ void readLayer(Data & data, int layer) {
}
readDir(
data, layer, rtl::Reference<Node>(), data.getComponents(), client,
- "/org/libreoffice/registry/");
+ getRoot(system) + "/");
}
void writeModifications(Components & components, Data & data) {
@@ -1567,8 +1572,7 @@ void writeModifications(Components & components, Data & data) {
}
for (auto const & i: data.modifications.getRoot().children) {
if (!addModifications(
- components, cs, "/org/libreoffice/registry",
- rtl::Reference<Node>(), i.first,
+ components, cs, getRoot(false), rtl::Reference<Node>(), i.first,
data.getComponents().findNode(Data::NO_LAYER, i.first),
i.second))
{
diff --git a/configmgr/source/dconf.hxx b/configmgr/source/dconf.hxx
index f7f59703754c..1086c77a3dd4 100644
--- a/configmgr/source/dconf.hxx
+++ b/configmgr/source/dconf.hxx
@@ -19,7 +19,7 @@ namespace configmgr {
namespace configmgr { namespace dconf {
-void readLayer(Data & data, int layer);
+void readLayer(Data & data, int layer, bool system);
void writeModifications(Components & components, Data & data);