[dconf: 4/7] common: factor out dconf_gvdb_utils_table_from_changeset
- From: Daniel Playfair Cal <danielplayfaircal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf: 4/7] common: factor out dconf_gvdb_utils_table_from_changeset
- Date: Sat, 19 Dec 2020 02:27:09 +0000 (UTC)
commit 5b24a937e12c85294d1172e41d21eb8504437f21
Author: Daniel Playfair Cal <daniel playfair cal gmail com>
Date: Mon Jan 6 12:41:23 2020 +1100
common: factor out dconf_gvdb_utils_table_from_changeset
common/dconf-gvdb-utils.c | 13 +++++++++++--
common/dconf-gvdb-utils.h | 1 +
2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/common/dconf-gvdb-utils.c b/common/dconf-gvdb-utils.c
index 56609cc0..0aced4cd 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)
diff --git a/common/dconf-gvdb-utils.h b/common/dconf-gvdb-utils.h
index 4bd4cd97..799c66c7 100644
--- a/common/dconf-gvdb-utils.h
+++ b/common/dconf-gvdb-utils.h
@@ -28,6 +28,7 @@ DConfChangeset * dconf_gvdb_utils_changeset_from_table (GvdbTab
DConfChangeset * dconf_gvdb_utils_read_and_back_up_file (const gchar *filename,
gboolean *file_missing,
GError **error);
+GHashTable * dconf_gvdb_utils_table_from_changeset (DConfChangeset *database);
gboolean dconf_gvdb_utils_write_file (const gchar *filename,
DConfChangeset *database,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]