writability



Hi,

One of the remaining TODO items was to implement
gconf_engine_key_is_writable() indicating whether a key was actually
changeable by the user. The idea is that an application should
desensitize widgets for changing the key, if the key isn't writable.

A key will be nonwritable in two common cases: a) the sysadmin has
overridden that key and b) the user's GConf configuration is hosed
and they have nowhere to put config data.

Previously GConf behaved as follows:
 - in case a), you would get an error on trying to set the key,
   and you'd have to display sort of a confusing error message
   to the user
 - in case b), gconf would silently fail to save config data, 
   dropping all settings into a black hole

Now GConf behaves as follows:
 - in both cases a) and b), attempting to set values will result 
   in errors, and gconf_client_key_is_writable() will return 
   FALSE - so you can avoid setting these values, e.g. by 
   making the preferences widgets insensitive

In the course of changing this, it became clear to me that 
all APIs that involved passing a value, a key, and is_default, etc. 
should just be using GConfEntry instead. In particular, I was going to
have to break GConf change notification callbacks to take an
is_writable argument, adding to the already huge argument list;
instead, I just changed the callback to take a GConfEntry which
inclues writability, etc.

Note that GConfClient caches writability along with everything else,
so calling gconf_client_key_is_writable() should be fast.

This causes yet more breakage, many apologies. But, hopefully this is
the last time before GNOME 1.4.

Havoc





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