possible way to list the configured databases



hello

i wonder if the following patch , which if applied produces output
similar to this:

yaneti indigo:~/space/gconf-1-0/gconf$ ./gconftool-1 --list-databases
xml:readonly:/home/yaneti/local/etc/gconf/gconf.xml.mandatory
xml:readwrite:/home/yaneti/.gconf
xml:readonly:/home/yaneti/local/etc/gconf/gconf.xml.defaults
yaneti indigo:~/space/gconf-1-0/gconf$

would be found acceptable?
if so i will gladly patch the remaining bits (ChangeLog, docs, whatever
is needed)

cheers
yanko

patch follows:
Index: gconf/gconftool.c
===================================================================
RCS file: /cvs/gnome/gconf/gconf/gconftool.c,v
retrieving revision 1.51.2.7
diff -u -b -p -r1.51.2.7 gconftool.c
--- gconf/gconftool.c	2001/07/28 06:17:39	1.51.2.7
+++ gconf/gconftool.c	2001/07/31 01:49:52
@@ -46,6 +46,7 @@ static int spawn_gconfd = FALSE;
 static char* short_desc = NULL;
 static char* long_desc = NULL;
 static char* owner = NULL;
+static int list_databases = FALSE;
 static char* schema_file = NULL;
 static char* config_source = NULL;
 static int use_local_source = FALSE;
@@ -240,6 +241,15 @@ struct poptOption options[] = {
     N_("FILENAME")
   },
   {
+    "list-databases",
+    '\0',
+    POPT_ARG_NONE,
+    &list_databases,
+    0,
+    N_("List the configured databases"),
+    NULL
+  },
+  {
     "config-source",
     '\0',
     POPT_ARG_STRING,
@@ -527,6 +537,25 @@ main (int argc, char** argv)
         return 2;
     }
   
+  if (list_databases)
+    {
+      int i;
+      gchar** addresses;
+      gchar* conffile;
+      
+      conffile = g_strconcat(GCONF_CONFDIR, "/path", NULL);
+
+      /* send the internal output to the log */      
+      gconf_set_daemon_mode (TRUE);
+      
+      addresses = gconf_load_source_path(conffile, NULL);
+      
+      for (i = 0; addresses[i] != NULL;i++)
+        printf("%s\n", addresses[i]);
+      
+      return 0;
+    }
+
   if (makefile_install_mode)
     {
       g_assert (config_source == NULL);




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]