Re: Checking for a non-existant key?



Archit Baweja <bighead users sourceforge net> writes:
> 
> Here is the scenario. I have a key say "/apps/foobar/something" which is of
> (or is supposed to be) type boolean. The very first time I run my program, how
> do I check if the key exists or not? I want to know this, so that I can setup
> default values in the prefs for my app.
>

As Christophe says, the general idea is that the default is returned
from gconf_client_get_bool(), because of the schemas.

But if you really care if the value exists, you need to use
gconf_client_get() instead of get_bool(), and see if it's NULL.

Havoc



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