summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2013-01-11 19:28:44 -0500
committerRyan Lortie <desrt@desrt.ca>2013-01-11 19:28:44 -0500
commit610fd3c06f2b581c69d374de7e5e0e8bef8359bf (patch)
tree3d0a031b5fbb93ef60bf119cef9fd4fe78e68d81 /service
parentbdd4dc68f54f9700a9b7c13cf035b0deba03612c (diff)
downloaddconf-610fd3c06f2b581c69d374de7e5e0e8bef8359bf.tar.gz
keyfile: implement list()
Diffstat (limited to 'service')
-rw-r--r--service/dconf-keyfile-writer.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/service/dconf-keyfile-writer.c b/service/dconf-keyfile-writer.c
index e41d0fe..29383f5 100644
--- a/service/dconf-keyfile-writer.c
+++ b/service/dconf-keyfile-writer.c
@@ -127,6 +127,27 @@ dconf_keyfile_to_changeset (GKeyFile *keyfile,
static void
dconf_keyfile_writer_list (GHashTable *set)
{
+ const gchar *name;
+ gchar *dirname;
+ GDir *dir;
+
+ dirname = g_build_filename (g_get_user_config_dir (), "dconf", NULL);
+ dir = g_dir_open (dirname, 0, NULL);
+
+ if (!dir)
+ return;
+
+ while ((name = g_dir_read_name (dir)))
+ {
+ const gchar *dottxt;
+
+ dottxt = strstr (name, ".txt");
+
+ if (dottxt && dottxt[4] == '\0')
+ g_hash_table_add (set, g_strndup (name, dottxt - name));
+ }
+
+ g_dir_close (dir);
}
static gboolean dconf_keyfile_update (gpointer user_data);