Re: GtkFileChooser filter API



Hi Owen,

On Thu, 2003-07-17 at 21:50, Owen Taylor wrote:
> void gtk_file_filter_add_custom (GtkFileFilter    *filter,

	...

> Any sort of custom filter system will cause difficulties for 
> an out-of-process implementation of GtkFileChooser; that's not
> something I'm particularly interested in, but there have been
> requests to leave the possibility open for the future.

	So - I'm not sure that having a callback API is an incredibly massive
problem for a component based solution - there are several ways to make
it more efficient - by chunking the filenames for the IPC. I would
however prefer to minimise the use of it by ensuring it's not the only
way.

	I'm more concerned that people will do the kind of crack-smoking idiocy
of open/search-for-favorite-string-in-file/close type stuff, that will
not scale at all well to remote files.

	Furthermore; while it seems good to have custom filters - hopefully,
these will not be the common case; indeed, simply having a load of extra
function signatures / callbacks and functions that just do:

	if (!strcmp (mime_type, "x-application/gnumeric"))
		return TRUE;

	or whatever - seems an unnecessarily pedestrian and pointless way to
expose a common case that can be nicely optimised - ie. I think the
pattern, and mime cases are sufficiently 'cheezy' and useful enough that
97.13% of people will not bother using the other stuff.

	Also given the proliferation of duplicate mime types for the same file
type, it's nice to have (as you suggest):
	
	GtkFileFilter *filter = gtk_file_filter_new ();
	gtk_file_filter_set_name (filter, "an Excel spreadsheet");
	gtk_file_filter_add_mime_type (filter, "x-application/excel");
	gtk_file_filter_add_mime_type (filter, "x-vnd/foo-excel");
	etc.

	Having said that - making the common case easier for your users implies
that gtk+/glib has to do the foot-work to ensure that the mime-type is
actually correct / exists [ but presumably it's better for gtk+ to get
that right than the user to suffer ].

	Anyway; I'm sure you'll come up with something nice,

	Regards,

		Michael.

-- 
 michael ximian com  <><, Pseudo Engineer, itinerant idiot




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