On Tue, Feb 02, 2016 at 09:44:52PM +0100, Landry Breuil wrote:
> On Tue, Feb 02, 2016 at 09:34:13PM +0100, Dmitrij D. Czarkoff wrote:
> > Landry Breuil said:
> > > Im not sure 'feature-set-wise' that it's worth adding the complexity of
> > > a FLAVOR.
> > 
> > Flavors were supposed to address the "half GNOME" issue.
> 
> Sure, but in that particular case it turned into 'do you want your mime
> detection to be done with gtk+ (booooo gnome blooaaat) or with libmagic
> (booooo full of security issues)' :)
> 
> Honestly, try both implementations, figure out which one 'performs'
> better in termes of filetype detection, and choose the less worst :) or
> just disable the feature if it not used much/broken.
> 
> Doing a FLAVOR for this is just overkill, as 99% of the users wont know
> which one to choose (shall we build both by default?), and expect a
> non-no_x11 flavor to have some kind of GUI..

Oh, and the code in src/int/file_magic.c even has a fallback to use file
%s -b --mime-type called via popen()..

In terms of priority:
-----------
  if(get_gtk_mimetype(file, mimetype) == -1) 
  {
    if(get_magic_mimetype(file, mimetype) == -1) 
    {
      if(get_file_mimetype(file, mimetype, sizeof(mimetype)) == -1) 
        return NULL;
    }
  }
-----------

So by default the primary method is gtk, then magic, then file.

And if i still look at the code... one of the uses of getting the
mimetype of a file seems to be.. to print the mimetype. Another (grep -r
get_handlers) seems to be to propose the various mimetype handlers found
in the desktop files to handle it. am i reading this right ?

Oh well.

Landry

Reply via email to