[Thunar-workers] [DokuWiki] page changed: design:mime-system
thunar-workers at xfce.org
thunar-workers at xfce.org
Mon Mar 7 00:52:27 CET 2005
A page in your DokuWiki was added or changed. Here are the details:
Date : 2005/03/06 23:52
Browser : Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050122 Firefox/1.0
IP-Address : 217.229.249.18
Hostname : pD9E5F912.dip.t-dialin.net
Old Revision: http://thunar.xfce.org/wiki/design:mime-system?rev=1108155096
New Revision: http://thunar.xfce.org/wiki/design:mime-system
Edit Summary:
User : benny
@@ -2,9 +2,8 @@
The MIME System is a vital part of the file manager. But it is important
that the MIME System can be used outside Thunar at a later time (e.g. in
the Xfce panel), so care should be taken during the design.
-
===== MIME-type detection =====
The most important and most critical task of the MIME System is to
@@ -13,9 +12,9 @@
entity used in Thunar.
A basic standard-compliant implementation could like this:
- {{design:mime:20050208-mime_type_detection.png}}
+ {{design:mime:20050307-mime_type_detection.png}}
This process describes the detection of the primary MIME-type. The
other associated MIME-types will be determined by following the
subclassing and aliasing rules.
@@ -27,8 +26,13 @@
:!: A possible implementation of the [[implementation:mime-glob-match|Glob
Match]] is available, which features nice optimizations already.
+
+ ==== Implementation Hints ====
+ A few hints for the implementation:
+
+ * Don't read the file contents when starting the MIME type detection unless there's actually a magic rule > 80 present in the database (by default the Shared MIME Database does not contain such a rule). That way, we can completely skip reading the contents for a lot of files, that will simply match one of the Glob rules.
===== Glob/Magic Rules =====
Every glob rule has a source file (''$XDG_DATA_DIRS/mime/globs'') and
every magic rule has a source file (''$XDG_DATA_DIRS/mime/magic''). So,
--
This mail was generated by DokuWiki at
http://thunar.xfce.org/wiki/
More information about the Thunar-workers
mailing list