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



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 :)

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?

Salu2

-- 
Fernando Herrera de las Heras
Onírica: análisis, diseño e implantación de soluciones informáticas
http://www.onirica.com



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