Re: possible way to list the configured databases



Yanko Kaneti <yaneti declera com> writes:
> 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)

What is the intended use for this feature? (I'm just curious - maybe
we need other features like this, or could make the feature better.)
    
> +  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);

If gconf_load_source_path has a bunch of debug spew, then we should
instead make it take a "gboolean do_logging" argument or the like.
Daemon mode potentially affects things other than logging.

> +      
> +      addresses = gconf_load_source_path(conffile, NULL);
> +      
> +      for (i = 0; addresses[i] != NULL;i++)
> +        printf("%s\n", addresses[i]);
> +      
> +      return 0;
> +    }
> +

I'm somewhat worried that we need to ask the daemon for the list of
config sources, instead of doing it here. Remember the daemon and
gconftool may not be from the same version of GConf, though that would
be unusual.

This may not be a real issue though. Your patch has simplicity on its
side. ;-)

Havoc




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