Re: About gsettings aborting on unkown schemas

On 11-05-27 9:46 AM, Milan Bouchet-Valat wrote:
> Le vendredi 27 mai 2011 à 08:51 -0700, Hubert Figuiere a écrit :
>> First, if the UI file is missing the application does not abort. There
>> is an error but it can be handled by the application, and eventually
>> recovered gracefuly. I deleted all the UI files and my app didn't crash.
>> Sure it was not very functional but I actually had the opportunity to
>> show a proper error message to the user. Not a crash.
> That's already what you get:
>     g_error ("Settings schema '%s' is not installed\n", name);
> I really can't imagine what you could do from a program missing its
> schemas, except if you hardcode (i.e. duplicate) all default values in
> the code to handle this broken case, which we actually want to avoid.

I can't really imagine GSettings knowing about MY use case and HOW I
manage my settings.

That GSettings wants to offer mechanism to enforce a schemas, fine.
That GSettings crash because a schema is missing, not so much. After all
Gtk not crash when you pass NULL to a gtk_widget_*() function, it does
not crash if the GtkBuilder file ain't found.
That GSettings does not allow me to use it in a RELAXED way, not fine.

> You could probably show a GTK error dialog, but people that don't know
> to look at the console output wouldn't understand the settings issue
> anyway...

Or not. My code is *designed* to actually manage default value. Like UI
has default that people whine about. This is just good programing practice.

But the consensus seems to be clear for me. Glad that I abstracted
preference management already thinking at the time that gconf would go away.

The only reason I jumped into the thread is because I encountered the
problem. I even filed a bug thinking that eventually things would settle
and actually get fixed. But reading all for this it end up being
horribly disappointing.


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