[dconf] keyfile: implement list()
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] keyfile: implement list()
- Date: Sat, 12 Jan 2013 03:01:36 +0000 (UTC)
commit 610fd3c06f2b581c69d374de7e5e0e8bef8359bf
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Jan 11 19:28:44 2013 -0500
keyfile: implement list()
service/dconf-keyfile-writer.c | 21 +++++++++++++++++++++
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]