On Thursday 15 September 2011 09:00:45 you wrote:
> On 15 September 2011 08:50, David Faure <[email protected]> wrote:
> > On Wednesday 14 September 2011 20:01:10 Иван Комиссаров wrote:
> >> Michael, take a look at https://gitorious.org/qmime it almost
> >> finished. Can' look at what progress you have, but if you want to
> >> start from scratch i don't think it is a good idea.
> > 
> > It is definitely not "almost finished". It parses the raw XML instead of
> > parsing the generated plain text files, and it has its own copy of the
> > freedesktop.org.xml instead of looking up the system files (which should
> > be done with the QStandardPaths class I finished the MR for,
> > yesterday). (https://qt.gitorious.org/qt/qtbase/merge_requests/50)
> > 
> > Also, it exposes too much internals of the spec, such as the various
> > fields for magic (content-based) matching; this is all because
> > QtCreator has a GUI for defining your own mimetypes, but I can't think
> > of any use case for a user defining his own magic rules...
> 
> Use Case #1: Adding support for detecting new filetypes or filetypes
> not recognised by the system (e.g. the libmagic database and epub
> documents).

That's done by the application, not by the user with a GUI.
Applications can define new mimetypes by installing an xml file into a 
location that will be seen by update-mime-datase.
This does not require API with all the little details of the spec, it simply 
requires one xml file.

(epub is already in shared-mime-info though)

> Use Case #2: Improving the detection logic to better detect files
> based on content (e.g. the libmagic database rules for detecting zip
> files).

That's already in shared-mime-info.

> Use Case #3: Providing your own alternate file database to detect file
> types supported by your application in a robust, platform independant
> manner. For example, in an application I have, I just want 'xml' to be
> detected and not derived types (such as xhtml and docbook) as I read
> the root node of the xml document and select the appropriate handler
> based on that, using the mimetype logic for top-level content
> detection.

Mimetype inheritance takes care of that, no need to provide an alternate file 
database. With something like theMimeType.inherits("application/xml") you 
would be able to detect all xml and xml-derived types.

-- 
David Faure, [email protected], http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).

_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to