Re: Shouldn't integer functions return -1 on error.



On Sat, 2003-04-12 at 06:40, Jeff Franks wrote:
> Hi,
> 
> I noticed that gconf_client_get_int() returns zero if a key has no value 
> set, or the subdirectory doesn't exist. This means the only way to check 
> if a key has been previously set, say the first time an application 
> runs, is with
> gconf_client_dir_exists(). I tried using GError but no error gets 
> reported if a value has not been set for a key, or the key doesn't exist 
> yet.
> 
> Given that zero is a valid value (e.g. when storing enum values) 

On a related note: I've been told that its better if enums are not
stored as ints (despite the obvious convenience). See the section of the
docs starting with this
http://developer.gnome.org/doc/API/2.0/gconf/gconf-gconf.html#GCONFENUMSTRINGPAIR


Cheers
Yanko




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