Re: GConf changes [ was Re: GUADEC cancelled due to beer shortage ]



Hi,

On Tue, 2004-06-22 at 13:03, Fernando Herrera wrote:
> Tue, Jun 22, 2004 at 11:14:01AM +0100, Mark McLoughlin escribi� 
> >On Mon, 2004-06-21 at 18:58, Joe Marcus Clarke wrote:
> >
> >> Not to sound too dense, but does this also mean the files under
> >> $(SYSCONFDIR)/gconf/gconf.xml.defaults will change as well?  The reason
> >> I'm asking is that FreeBSD ports track installed files, and this will
> >> create massive plist changes for us.
> >
> >	Not usually. The system wide defaults and mandatory databases are
> >usually readonly (see the readonly flag in /etc/gconf/2/path) and we
> >don't attempt to coalesce the files in a readonly database.
> 
> 	Hum, I've just added support to gconf-editor to edit defaults
> and mandatory using:
> 	defaults_engine = gconf_engine_get_for_address (GCONF_DEFAULTS_SOURCE, NULL)
> 	and
> 	defaults_engine = gconf_engine_get_for_address (GCONF_MANDATORY_SOURCE, NULL)
> 
> 	so it's not so read only :)

	Right, I should have mentioned that. Using gconf-editor or gconftool-2
to edit the mandatory and defaults db with latest GConf will cause
%gconf-tree.xml files to be created if they didn't already exist.

> BTW, to check if the user has rights to edit them I'm using a little trick:
> 
> 	defaults_engine = gconf_engine_get_local (GCONF_DEFAULTS_SOURCE, NULL);
> 	gconf_engine_set_bool (defaults_engine, "/apps/gconf-editor/can_edit_defaults", FALSE, &error);
> 
> 	and check for errors. 
> 	Right now gconf_engine_get_local is a non-public declared
> function, but there is no other way to do that, because getting the
> engine with gconf_engine_get_for_address if the user have no write
> access with return an engine for user config database. I'm not 100%
> happy with this hack (for example the user gets an error in the terminal). 
> Any idea of how can I do this in a better way?

	Maybe try get_entry() and gconf_entry_get_is_writable() for any key?

Cheers,
Mark.




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