Shared-mime checking order

Alexander Larsson alexl at redhat.com
Tue Sep 18 02:20:54 PDT 2007


On Tue, 2007-09-18 at 11:18 +0200, Patryk Zawadzki wrote:
> On 9/18/07, Alexander Larsson <alexl at redhat.com> wrote:
> > On Tue, 2007-09-18 at 00:51 +0200, David Faure wrote:
> > > On Tuesday 28 August 2007, Alexander Larsson wrote:
> > > > If several globs matches, and sniffing fails, or doesn't help:
> > > >   fall back to the first glob match
> > > >   (maybe we should do something better here?)
> > >
> > > Hmm, I just found the case of "README.txt", which could either be "text/plain" due to *.txt
> > > or "text/x-readme" due to README*. Which one should we pick? The second pattern "looks"
> > > more specific to my eyes so it should probably win, but how should we quantify that?
> > > Should we take the longest pattern?
> >
> > Yeah, this is tricky. I think the longest pattern is the traditional way
> > to solve things like that. It will probably work good enought for us.
> 
> Isn't just enough to check if either of them is the subclass of the
> second? If so, pick the more specific one.

That only works in the case of subclasses though, which might not always
be the case. Seems right to use that when its possible though.




More information about the xdg mailing list