summaryrefslogtreecommitdiff
path: root/common/dconf-gvdb-utils.c
diff options
context:
space:
mode:
authorDaniel Playfair Cal <daniel.playfair.cal@gmail.com>2020-01-06 12:41:23 +1100
committerDaniel Playfair Cal <daniel.playfair.cal@gmail.com>2020-12-19 12:39:35 +1100
commit5b24a937e12c85294d1172e41d21eb8504437f21 (patch)
treebdcdebae05047c92667bc4b8ab5d405b44d5e6f8 /common/dconf-gvdb-utils.c
parent6edda52ed45feaaec203e51a23f4b50cc7d4b147 (diff)
downloaddconf-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.c13
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)