summaryrefslogtreecommitdiff
path: root/service/dconf-writer.c
Commit message (Collapse)AuthorAgeFilesLines
* service: Rename a method to make its behaviour more apparentPhilip Withnall2018-08-201-1/+1
| | | | | | | It’s a little counterintuitive that a function called ‘read’ could sometimes move a file (which could be considered a write). Signed-off-by: Philip Withnall <withnall@endlessm.com>
* service: Port from g_type_class_add_private() to G_ADD_PRIVATE()Philip Withnall2018-08-011-3/+2
| | | | | | The former has been deprecated for a long time. Signed-off-by: Philip Withnall <withnall@endlessm.com>
* Updated FSF's addressDaniel Mustieles2014-01-311-3/+1
|
* Add missing "config.h" include everywhereRyan Lortie2013-11-241-0/+2
| | | | We ought to be including this from each .c file.
* service: rewrite a line to avoid a gcc warningRyan Lortie2013-07-121-1/+2
| | | | gcc doesn't like 'a && b;' so use 'if (a) b;'.
* service: fix some harmless compile warningsRyan Lortie2013-07-121-4/+4
| | | | Mostly missing 'static'.
* service: fix a couple of leaksRyan Lortie2013-02-111-0/+1
| | | | | Fairly harmless leaks. One only happens in an error case (like the disk being full) and the other only happens on startup.
* writer: ignore empty changesetsRyan Lortie2013-02-111-7/+14
| | | | | | | | | | | | When emitting change signals, we call dconf_changeset_describe() to enumerate the keys to send the signal for. When the changeset is empty, this function returns NULL for the path vector. We pass that NULL into the signal emitter and the service crashes. We can avoid this situation by refusing to handle empty changesets in the first place.
* keyfile: many improvementsRyan Lortie2013-01-111-1/+4
| | | | | | | | | | | | | Store the keyfile in ~/.config/dconf/$(name).txt instead of ~/.config/dconf-keyfile/name. Adjust the base writer not to pick up filenames with dots in them (so we will skip the .txt files the keyfile writer puts into the same directory). Add file change monitoring and reload the file if anyone changes it. Fix a crasher on the first write of a file if it does not yet exist. Add proper finalize handling.
* writer: avoid spurious rewrites on InitRyan Lortie2013-01-111-1/+22
| | | | | Don't rewrite the gvdb file unless an actual change has been applied to the database (unless creating a non-native database for the first time).
* service: add a diff() operation on writersRyan Lortie2013-01-111-0/+7
| | | | | | | This diffs the given changeset with the uncommited changes in the writer. The result is effectively the changeset that would have to be applied to the writer to cause it to be equal to the passed-in changeset.
* service: add support for service-dbRyan Lortie2013-01-091-4/+24
| | | | | | Add support for service-db to the service. New types of service-dbs can be implemented via a GIOExtensionPoint.
* service: fix some harmless warningsRyan Lortie2013-01-091-1/+2
|
* writer: add list class virtual methodRyan Lortie2013-01-081-0/+33
| | | | | This populates a set with the names of databases available for a given writer class.
* writer: add @type argument to constructorRyan Lortie2013-01-081-2/+5
| | | | | dconf_writer_new() now takes a type so we can create subtypes of DConfWriter.
* writer: move instance and class struct into headerRyan Lortie2013-01-081-48/+35
| | | | | | | ...and add a lot of ->priv. This is not a public API because this header doesn't get installed, but it can now be used by other things in-tree.
* service/: don't call g_hash_table_unref on changesetRyan Lortie2013-01-021-1/+1
| | | | | | | | | | | | 4fce559d81bdd3841cfe16fd3a3e6b8e6e9e60f2 changed from using GHashTable to database-mode changesets for caching the state of the database in the service but we missed a case of g_hash_table_unref being called. Fix that now. Problem reported and fix suggested by Philippe Coval. https://bugzilla.gnome.org/show_bug.cgi?id=691013
* writer: Fix typo causing segfaults on service shutdownColin Walters2012-12-171-1/+1
| | | | | | Was seeing crashes in the latest gnome-ostree on login. https://bugzilla.gnome.org/show_bug.cgi?id=690316
* service: factor out gvdb read/write codeRyan Lortie2012-11-091-141/+11
| | | | | | | | Factor the code for reading and writing DConfChangeset databases to the gvdb file format out from dconf-writer.c. This will allow those functions to be used by other backend implementations that want to store things in gvdb format (like on NFS).
* service: fix some leaks in the writerRyan Lortie2012-11-081-7/+13
| | | | | | | | | | | Also, slightly change the rules about begin/change/commit/end. It used to be theoretically possible to call: begin(), change(), commit(), change(), end(). but that is no longer supported (and it was never used anyway). Now the only valid thing to do after a commit() is end().
* service: use database-mode DConfChangesetRyan Lortie2012-11-081-70/+44
| | | | | | | | | | Port the DConfWriter to use database-mode changesets to represent the contents of the database. This allows us to drop our own copy of the reset algorithm. Also, fix a bug whereby we tried to acquire a list of items from a NULL gvdb table (in the case where the database does not already exist).
* service: rewriteRyan Lortie2012-10-231-75/+411
| | | | | | | | | | | | | | | | Rewrite the dconf-service using gdbus-codegen and generally cleaning things up a lot. The DConfWriter class can now be reasonably subclassed to create more complex types of dconf databases (such as ones that are stored in the local runtime dir and synced up with an NFS home directory). Keep a cache of the keys in the database (instead of re-reading it every time we try to make a change). Drop support for the old D-Bus interface (now that we are two stable releases since it was used). Modify the commandline tool for 'dconf blame' to call the new interface.
* massive Makefile reorganisationRyan Lortie2012-07-081-1/+1
| | | | | | | | | | Clean up the Makefiles and make them as similar as possible. Move CFLAGS to a common point of definition and stop using -I so much. Replace the 'dbus stub' with libdconf-mock.a in tests/. Fill in some stubs for future mock code for shm and gvdb (just to get things compiling for now).
* clean up and factor out the 'shm' codeRyan Lortie2012-07-081-25/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the shm code from the engine and the service and put it in a separate convenience library in shm/. Remove the vestigial shmdir weirdness from the service (since shmdir is now always relative to XDG_RUNTIME_DIR and has been for some time). The purpose of this is so that dconf-engine can be properly unit-tested. dconf-engine now has five points of contact with the world (excluding the users of the engine themselves): - the DCONF_PROFILE environment variable - fopen() of profile files - shm - gvdb - dbus The environment variable is quite easily controlled. fopen() is intercepted in the engine testcase with a interpose of the libc symbol. With this commit now each of dbus, gvdb and shm are implemented in separate utility modules that can be mocked from the testcases.
* service: introduce a new Changeset-based methodRyan Lortie2012-07-011-0/+23
| | | | Add a "Change" method to the service for writing DConfChangesets.
* Remove 'set lock' support from dconfRyan Lortie2011-09-111-9/+0
| | | | | | | | | | | | | | | | | | The dconf service can not presently be run at the system level and it doesn't make sense to support locks on user-level databases. It also became clear that most distributors and sysadmins would rather work directly with text files anyway, so we supported that directly instead. For this reason, 'set lock' support has never been properly implemented. All the plumbing was added for it though, which means we have it appearing on the API of the client library and documented in the help of the commandline tool. This is misleading, since these functions do nothing at all (and actually contain bugs anyway since their do-nothingness was never actually tested). For now, we rip out these functions. We can add them back later if we decide to support this properly.
* Fix DBus introspection enumerationRyan Lortie2010-12-211-1/+4
| | | | | | It should also work for people who have usernames other than 'desrt' Closes #634229.
* service: avoid making invalid syscallsRyan Lortie2010-12-191-3/+10
| | | | | If we can't open the shm file then don't bother trying to write/close/unlink it.
* Store the state in the writerRyan Lortie2010-08-031-0/+1
| | | | ie: Fix unitialised variable
* service: new 'state' objectRyan Lortie2010-07-241-70/+12
| | | | | | | | Clean up the service a bit by putting its state into a separate object that is accessible from the DBus code and the writer. This way we avoid a circular dependency without sticking inappropriate data in the writer.
* bring service API in line with the clientRyan Lortie2010-07-191-0/+8
| | | | | also, cache GDBusConnections in the client since GDBus doesn't keep them alive for us.
* header cleanupRyan Lortie2010-07-181-0/+21
|
* add 'SetLock' method to the serviceRyan Lortie2010-07-171-0/+9
| | | | Wired up internally but does nothing so far.
* on NFS create a temp dir for the shm fileRyan Lortie2010-07-171-5/+7
| | | | dconf should be vaguely NFS-safe now
* Move shmdir guessing code to common/Ryan Lortie2010-07-171-4/+10
| | | | | | | Increase the intelligence of the algorithm: use ~/.cache/dconf as a reasonable default if not on NFS. The dconf engine now has a non-blocking startup when not on NFS.
* Many improvementsRyan Lortie2010-07-151-0/+166
- support the notion of 'profiles' This is how we will configure layering of databases in dconf. It's not wired-up yet (except to choose the name of the user database). - support multiple writers in the service Using the (very freshly API-broken) GDBus subtree support. Introspection returns the names of existing databases, but any object path can be used to create a new database. - support the start of the 'shm' file Used to prevent the reader from reopening the gvdb every time. dconf reads now involve zero system calls in the usual case. The server is queried on startup for the location of the shm files. By default, this is in ~/.cache/dconf/ for now. This won't work properly on NFS, but it's a start.