X-KDE-IsAlso=text/plain

David Faure faure at kde.org
Thu Jul 28 00:56:13 BST 2005


On Tuesday 26 July 2005 23:48, Nicolas Goutte wrote:
> On Tuesday 26 July 2005 22:18, Andras Mantia wrote:
> > On Tuesday 26 July 2005 22:47, Nicolas Goutte wrote:
> > > If your goal is to open text files, then I suppose that it is why
> > > X-KDE-Text was created (by the Kate developers if I remember well).
> >
> > BY Waldo on my request IIRC. ;-)
> >
> > > In any case, if a mime type has not a X-KDE-Text but is text-based,
> > > then this property should be added to that mime type.
> > >
> > > Also X-KDE-.Text is also part of the mime type database of
> > > freedesktop.org, so if we are switching to this database in KDE4, we
> > > should be careful that we would not have control anymore of what mime
> > > type "is also" another mime type.
> >
> > So this means X-KDE-Text is not deprecated and has different functiona
> > than X-KDE-IsAlso? I though that the latter deprecates the former, thus
> > my idea to change the mimetypes. If not, I will change the code in
> > KDevelop to not rely on isAlso when checking if a file is text or not.
> 
> Personally I think that these are not the same functions. We did not define 
> the mime types (but IANA did), so we should try not to change their meaning 
> either (even if this is not always easy).
> 
> As for X-KDE-Text being deprecated, sorry, if there was such a discussion, I 
> was not aware of it.

X-KDE-Text is a kde-specific hack from before mimetype inheritance, and it
should be deprecated IMHO.

The real solution is mimetype inheritance, and I don't see a problem with
"formatted text" inheriting from text/plain, whatever the strict definition
of text/plain originally was (keep in mind that it's a definition in a context where
mimetype-inheritance doesn't exist).
The freedesktop.org database has mimetype inheritance from text/plain for
many mimetypes (even those scripting mimetypes like application/x-php),
(I'm the one who provided a patch for that at some point), so let's please
use that so that the migration to the fd.o database is possible at some point.

The rule for finding a viewer/editor is that an application for a more-specific
mimetype is always preferred over an application for a more-generic mimetype,
so this reduces the risk of getting kwrite for xml-derived types : this can only
happen if you have no better viewer installed at all, not just due to some
preference misconfiguration; and in that case, well, it's better than nothing.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kde-core-devel mailing list