Re: Adding error reporting to GtkFileChooser



> Sure, errors can occur, but the question is what is the
> app going to do if the error fails?

> If something has an error return in the API, then you are
> saying that the caller must handle it.

Certainly.  There are at least two reasons for an error return:

1. Tell the user.
2. Bail out of composite operations.

Re. 2, see function gtk_file_chooser_default_select_path.  If the last call
to _gtk_file_chooser_set_current_folder_path fails, it'll never know.  Then
it will go on to do a bogus _gtk_file_system_model_path_do call.  A gboolean
would do for this.

> The question though we always have to answer is "can the app do better than
> what GtkFileChooserDialog should (like ignore)".

As the example above shows, ignore is not always a good choice, and without
at least a gboolean return value that is all the choice you have.

Morten



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