Re: GConf - defaults.

Dietmar Maurer <dietmar ximian com> writes:
> I do not suggest to remove the ability to get default values from the
> configuration engine. But what do you do when:
> gconf_client_get_int (c, "user_level", ...)
> fails? Do you exit the program? I suggested to do something useful instead.

What do you do when loading a glade file fails?

I don't think doing something useful would be bad (and at the moment
it's encouraged since the guarantee of that call not failing is not as
strong as it should be). But I'm not sure I'd worry about it all that
much, especially if we can improve the strength of the guarantee.

You do still need to validate the returned values to be sure they make
sense (in proper range, etc.) of course.

But I would think on validation failure we'd have a
definitely-won't-fail kind of function:
 get_default_value ("user_level")

which could be used for fallback.

I'm talking about the ideal situation, of course.


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