summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-07-02 00:49:46 -0400
committerRyan Lortie <desrt@desrt.ca>2012-07-02 00:49:46 -0400
commit4eea8cb823c5a113d8209b04102f17f08df853d6 (patch)
tree5a8bb7d0c220e00981c0f0ba6e834ac8e1f6e584 /common
parent6a675a5bdef5949e2397b0d5ca9d0c8a36ccedfd (diff)
downloaddconf-4eea8cb823c5a113d8209b04102f17f08df853d6.tar.gz
Massively reorganise the client-side
This commit represents a rather complete rethinking of DConfEngine. - the different kinds of sources are now properly abstracted. This will make landing NFS support substantially easier. - there is now substantially more internal documentation - DConfEngineMessage is gone and replaced with ordinary function calls to be implemented by the D-Bus glue code - the GDBus glue has been factored out and is now shared between the client library and GSettings - the "outstanding" queue logic from the GSettings backend is now in the engine - all changes now go through a single API that accepts a (new) DConfChangeset object. Currently this only supports the current operations (ie: setting and resetting). In the future this object will also support the directory operations required by GSettingsList and will be the basis for the new approach to implementing the 'delayed' GSettingsBackend (which will be the method by which those two concepts can co-exist). The (internal) API of the engine changed substantially. This caused the following: - the libdconf client library has been rewritten in C. Most of the complicated aspects of it (that made it more convenience to use Vala) are now gone. - during the rewrite of libdconf, the DConfClient API changed a bit to look more like a proper GObject. It now makes GIO-style use of thread-default main contexts and uses GObject signals for notifications (instead of hand-rolled callbacks). - the GSettings backend has been substantially simplified (the "outstanding" logic is gone). No externally-visible changes. - the dbus-1 backend has taken a copy of the old engine code for now until it can be ported to the new engine and sufficiently tested. No externally-visible changes. - the dconf commandline tool and dconf-editor required minor changes to adjust to the DConfClient API changes There is a substantial amount of cleaning up and finishing of work to be done. There are many stubs remaining. There are likely still a large number of bugs.
Diffstat (limited to 'common')
-rw-r--r--common/dconf-changeset.c15
-rw-r--r--common/dconf-changeset.h3
2 files changed, 17 insertions, 1 deletions
diff --git a/common/dconf-changeset.c b/common/dconf-changeset.c
index 43dbe42..8434a2e 100644
--- a/common/dconf-changeset.c
+++ b/common/dconf-changeset.c
@@ -49,6 +49,7 @@ dconf_changeset_new (void)
change = g_slice_new0 (DConfChangeset);
change->table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
+ change->ref_count = 1;
return change;
}
@@ -100,7 +101,7 @@ dconf_changeset_set (DConfChangeset *change,
{
g_return_if_fail (change->root == NULL);
- g_hash_table_insert (change->table, g_strdup (key), g_variant_ref_sink (value));
+ g_hash_table_insert (change->table, g_strdup (key), value ? g_variant_ref_sink (value) : NULL);
}
/**
@@ -410,3 +411,15 @@ dconf_changeset_deserialise (GVariant *serialised)
return change;
}
+
+DConfChangeset *
+dconf_changeset_new_write (const gchar *path,
+ GVariant *value)
+{
+ DConfChangeset *changeset;
+
+ changeset = dconf_changeset_new ();
+ dconf_changeset_set (changeset, path, value);
+
+ return changeset;
+}
diff --git a/common/dconf-changeset.h b/common/dconf-changeset.h
index 930c09b..de062fa 100644
--- a/common/dconf-changeset.h
+++ b/common/dconf-changeset.h
@@ -32,6 +32,9 @@ typedef gboolean (* DConfChangesetPredicate) (const g
DConfChangeset * dconf_changeset_new (void);
+DConfChangeset * dconf_changeset_new_write (const gchar *key,
+ GVariant *value);
+
DConfChangeset * dconf_changeset_ref (DConfChangeset *changeset);
void dconf_changeset_unref (DConfChangeset *changeset);