Re: DynamicMimeTypes



On Wed, 2007-08-15 at 21:34 +0100, Alex Jones wrote:
> On Wed, 2007-08-15 at 14:17 -0500, Shaun McCance wrote:
> > On Tue, 2007-08-14 at 23:18 +0100, Alex Jones wrote:
> > > Hi List
> > > 
> > > Applications like Rhythmbox and Totem have content handling capabilities
> > > that are dependent on GStreamer. Currently, they have to hardcode a list
> > > of MIME types in their Desktop Entries, which sucks a bit.
> > > 
> > > So how about we try something like I've sketched up in the attached
> > > diagram.
> > > 
> > > Rhythmbox can then say that it can handle all file types given by the
> > > registered "org.gstreamer.Audio" handler, which will return something
> > > like:
> > > 
> > > audio/mpeg
> > > audio/x-vorbis+ogg
> > > audio/x-flac
> > > ...
> > > 
> > > And these types can be munged in with the rest of the types listed in
> > > the Desktop Entry.
> > > 
> > > Also if someone else could think of some better terminology, that would
> > > be super.
> > 
> > There are other cases where we can't just query a library
> > like GStreamer.  Take, for example, File Roller.  It can
> > handle *LOTS* of archives formats, but only if you have
> > the command line tools for those formats installed.
> > 
> > What if we just added a MimeTypeExec field which gives
> > a command to run.  This command should give a list of
> > MIME types that are actually supported.
> > 
> > Then file-roller.desktop could have this:
> > 
> >   MimeTypeExec=/usr/libexec/file-roller-mime-types
> > 
> > And Ryhthmbox and Totem and such could call some
> > command supplied by GStreamer.
> 
> The only difference between this and what I suggested is that you are
> giving an explicit path to a script (what I was calling a "handler") to
> be run. It's the same idea.

OK, I guess I don't quite understand where the handler fits in.

What I've seen in the past are proposals involving MIME groups,
which could be specified in something like desktop entry files.
These proposals always assumed that a plug-in will also install
some sort of data to add a MIME type to a group.  This, to me,
is a weakness, because there are things like File Roller which
just depend on command line programs.  And I think there's very
little chance we'll ever see programs like rar or zoo shipping
with a data file to tell the desktop that File Roller can also
handle their formats.  But a custom script shipped with File
Roller could easily check for the existence of these programs.

Could you explain in a bit more detail how your handlers work?

--
Shaun





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]