DConfChangeset: implement dir resets properly
commitc6423fa1cacb9fb3178016e712be9323a743bce4
authorAllison Ryan Lortie <desrt@desrt.ca>
Mon, 30 Nov 2015 16:40:25 +0000 (30 16:40 +0000)
committerAllison Ryan Lortie <desrt@desrt.ca>
Mon, 30 Nov 2015 16:40:32 +0000 (30 16:40 +0000)
treee26e41de0cee7d0eb5f9de82159fe37e73ba5674
parent4ef5a2a4c6ac349f51a1cd5f9013efe8c5f26f12
DConfChangeset: implement dir resets properly

If a dir is reset against a DConfChangeset then the result ought to be
that all keys under that dir read as NULL (until such a time as they are
set to a new value).

This is consistent with the (existing) behaviour that a key will read as
NULL if it, itself, was reset.

In order to make that efficient, we create a separate GHashTable to
serve as a cache of all of the directories that have been reset and
iterate it whenever we do a key lookup that doesn't have a direct hit.

We update (and expand) the test case to reflect this new reality -- the
tests actually had a case that relied on the inconsistent behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=744678
common/dconf-changeset.c
tests/changeset.c