Re: Patch: Wrong fileTypeForSuffix()

Subject: Re: Patch: Wrong fileTypeForSuffix()
From: Andrew Dunbar (
Date: Mon Jun 18 2001 - 09:47:52 CDT

Hubert Figuiere wrote:
> According to Andrew Dunbar <>:
> > It turns out that it makes a difference whether you call the
> > importer's version of this versus the exporter's version.
> > For instance, .abw and .abt are classed as the same for importing
> > but different for exporting. Calling the wrong function was causing
> > the OpenSaveAs dialog to default to the wrong filetype at least on
> > Windows.
> Isn't this similar, or the reason of bug 1550 ?

Well I've looked into it and it is related after all. Problem
is that filetype means more than one thing. It is the index
of the filetype sniffer in order of being registered. But since
importers and exporters are separate and not an exact 1:1 match
we cannot ever assume this index will work for both loading
and saving. But we do do this.

We have to separate this index from our notion of FileType.
The indeces are useful for the OpenSaveAs dialog but should
not be the filetype. We need methods to map between FileType,
OpenIndex and CloseIndex.

I actually thinkg making the filetype a string might be a
better approach. This "ID" could be part of the import/export
registration process. If it's a string we'll be able to
use it to support options in the future, such as file encoding,
and we'll be able to pass this string rather than the file
suffixes - which are already shared in some cases. RTF / RTF attic;
Text, HRText, Encoded Text...


Andrew Dunbar.


Do You Yahoo!?
Get your free address at

This archive was generated by hypermail 2b25 : Mon Jun 18 2001 - 09:46:04 CDT