diff options
author | Daniel Playfair Cal <daniel.playfair.cal@gmail.com> | 2020-01-06 12:41:23 +1100 |
---|---|---|
committer | Daniel Playfair Cal <daniel.playfair.cal@gmail.com> | 2020-12-19 12:39:35 +1100 |
commit | 5b24a937e12c85294d1172e41d21eb8504437f21 (patch) | |
tree | bdcdebae05047c92667bc4b8ab5d405b44d5e6f8 /common/dconf-gvdb-utils.c | |
parent | 6edda52ed45feaaec203e51a23f4b50cc7d4b147 (diff) | |
download | dconf-5b24a937e12c85294d1172e41d21eb8504437f21.tar.gz |
common: factor out dconf_gvdb_utils_table_from_changeset
Diffstat (limited to 'common/dconf-gvdb-utils.c')
-rw-r--r-- | common/dconf-gvdb-utils.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/common/dconf-gvdb-utils.c b/common/dconf-gvdb-utils.c index 56609cc..0aced4c 100644 --- a/common/dconf-gvdb-utils.c +++ b/common/dconf-gvdb-utils.c @@ -193,6 +193,16 @@ dconf_gvdb_utils_add_key (const gchar *path, return TRUE; } +GHashTable * +dconf_gvdb_utils_table_from_changeset (DConfChangeset *database) +{ + GHashTable *table; + + table = gvdb_hash_table_new (NULL, NULL); + dconf_changeset_all (database, dconf_gvdb_utils_add_key, table); + return table; +} + gboolean dconf_gvdb_utils_write_file (const gchar *filename, DConfChangeset *database, @@ -201,8 +211,7 @@ dconf_gvdb_utils_write_file (const gchar *filename, GHashTable *gvdb; gboolean success; - gvdb = gvdb_hash_table_new (NULL, NULL); - dconf_changeset_all (database, dconf_gvdb_utils_add_key, gvdb); + gvdb = dconf_gvdb_utils_table_from_changeset (database); success = gvdb_table_write_contents (gvdb, filename, FALSE, error); if (!success) |