Re: GtkBuilder report
- From: Emmanuele Bassi <ebassi gmail com>
- To: gtk-devel-list gnome org
- Subject: Re: GtkBuilder report
- Date: Tue, 23 Jan 2007 21:37:06 +0000
hi Tristan;
On Tue, 2007-01-23 at 15:51 -0500, Tristan Van Berkom wrote:
> > and how do you propose to gracefully recover from the absence of the
> > whole user interface definition? if such a thing happens in production
> > if means you've screwed up the installation of the application so badly
> > that you can't really trust anything to be working correctly - hence an
> > abort() is the Right Thing(tm) to do; if this happens during a
> > development cycle, then you'll be monitoring the standard error anyway,
> > so whether gracefully presented to you or not, you're going to notice
> > the error.
>
> I dont think its right to assume what the builder will be used for,
> that it will be currently parsing the main UI description, a random
> dialog that might have been introduced by a semi-trustworthy plugin,
> or a few serialized GObjects passed over an internet link.
in this case it could compromise the security of the application and of
its data, so it would be even more compelling to make everything fail.
> My opinion is quite simply, if we dont crash when loading a jpeg,
> we shouldnt crash when loading a glade file.
because a jpeg image doesn't define your application - a UI definition
file does. :-)
+++
a middle ground can be found, though. just as GConf invokes the default
error handler if you pass NULL instead of an empty GError structure,
gtk_builder_load_from_file() could abort() on error if no GError
structure is passed to it. another approach might be emitting a
"parse-error" signal with or without a return value: if the callback
returns FALSE, the application dies - for those of us who prefer a more
drastic approach to error handling.
ciao,
Emmanuele.
--
Emmanuele Bassi, E: ebassi gmail com
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]