Re: About gsettings aborting on unkown schemas



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.
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...

The only place where it makes sense not to exit is for an application
that loads extensions. Maybe it's worth having a convenience function
around g_settings_list() to check the schema is present before loading
it...


Cheers




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