Supporting mime types in desktop actions

David Faure faure at kde.org
Tue May 22 09:49:00 PDT 2012


On Saturday 19 May 2012 17:08:16 Jerome Leclanche wrote:
> On Sat, May 19, 2012 at 12:06 PM, David Faure <faure at kde.org> wrote:
> > There's no code in Qt yet, at this point it would be
> > kdelibs/kded/kmimeassociations.cpp
> > in git://anongit.kde.org/kdelibs
> 
> Heads up: There will be code in Qt in 5.0.

If you mean QMimeDatabase/QMimeType, I should know, I wrote it :-)
But that's only the shared-mime-info spec, not the mime-associations spec.

BTW, you wrote earlier:
> The syntax itself for mimeapps.list would not require an update as it's
> just a "list of strings", although I don't think mimeapps.list actually
> has a spec anywhere.

But actually there is a spec, at
http://www.freedesktop.org/wiki/Specifications/mime-actions-spec

> > I'm confused over all, because mimeapps.list is about application desktop
> > files, not just about desktop files that define desktop actions. So, what
> > should
> > happen when writing image/png=myapp.desktop[Edit];
> > and myapp.desktop simply says Exec=gimp ? Nothing new, right?
> 
> Right. When looking at an image/png file, xdg-open will
> see myapp.desktop[Edit], go in myapp.desktop and look for a [Desktop Action
> Edit] section.

Ah! I understand now.
mimeapps.list *was* about desktop files without actions, but your proposal is 
to change exactly that! :-)

Now the only thing I don't understand, is in which case would xdg-open [which 
is just one of the users of mimeapps.list BTW] look for "Edit"? From your 
description, it sounds like it would just stumble upon that as being the 
preferred action...
So basically if I put image/png=myapp.desktop[Print] in mimeapps.list, every 
time I click on a PNG in a file manager it will print it...

But that's not what you wanted, is it?
You simply wanted the "Print" action to show up in the contextual menu over 
png files, even if the definition of the print action (in the root-owned desktop 
file) mentionned other mimetypes than png files.

So this is the problem I have with this suggested change for mimeapps.list:
for the desired effect of "adding a mimetype to an action", it has the side 
effect of "making it the default action for this mimetype", unless the full 
list of current associated applications is written out in mimeapps.list too, 
to ensure the added action is only at the end of the list.

I think this is mixing two things, really.

If the goal is to add a mimetype to a specific action, but without changing 
what happens when simply opening a file, then it should be done in a separate 
file, or in a separate group ([Added Action Associations]) in mimeapps.list.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. KDE Frameworks 5



More information about the xdg mailing list