On Mon, 29 Jun 2009 07:18:35 +0700
Mikhail Gusarov <dotted...@dottedmag.net> wrote:

> Hello,
> 
> I've stumbled upon the problem with lower-priority mime-types matching
> in Efreet. Let's see the definition of application/x-palm-database and
> application/x-aportisdoc:
> 
> <mime-type type="application/x-palm-database">
>   <comment>Palm OS database</comment>
>   <glob pattern="*.pdb"/>
>   <glob pattern="*.prc"/>
>   <alias type="application/vnd.palm"/>
> </mime-type>
> 
> <mime-type type="application/x-aportisdoc">
>   <comment>AportisDoc document</comment>
>   <sub-class-of type="application/x-palm-database"/>
>   <generic-icon name="x-office-document"/>
>   <magic priority="50">
>     <match value="TEXtREAd" type="string" offset="60"/>
>     <match value="TEXtTlDc" type="string" offset="60"/>
>   </magic>
>   <glob pattern="*.pdb"/>
>   <glob pattern="*.pdc"/>
> </mime-type>
> 
> According to definition, file with .pdb extension and 'TEXtREAd' text
> at offset 60 should be matched as application/x-aportisdoc.
> 
> Though the actual algorithm is as follows:
> 
> - check for the high-priority (> 80) magics. None.
> - check for the globs. application/x-palm-database matches. Let's
> return it.
> 
> Whoops. magic priority=50 was not even considered. Raising the
> priority to 80 helps, but this is just a workaround.
> 
> Any ideas of how to improve the algorithm?
> 

Well when I wrote this code, I followed the recommended checking order
at the time which is located here:

http://standards.freedesktop.org/shared-mime-info-spec/0.15/ar01s02.html#id2568464

Since then they have changed their mind and also the specification
slightly.  There are now new files with extra information such as globs
with weights.  Efreet does not follow any of this new specification to
my knowledge so updating it would probably help solve the problem you
describe.


------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to