Supporting mime types in desktop actions
Jerome Leclanche
adys.wh at gmail.com
Fri Nov 2 09:58:23 PDT 2012
Sorry David, really (really) late reply.
Yes, if image/png=myapp.desktop[Print] is specified, printing the png
becomes the default action. Yes, it sounds awkward in that situation, but
who would assign it like this?
The idea behind the addition is to be able to specify *extra* actions in
addition to the "main" one, so it would more likely look like
image/png=myapp.desktop;myapp.desktop[Print];myapp.desktop[Share]
And in a context menu it would look something like:
====
Open
Copy
Open with... >
- My App (default)
-------
- Print with My App
- Share with My App
J. Leclanche
On Tue, May 22, 2012 at 5:49 PM, David Faure <faure at kde.org> wrote:
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xdg/attachments/20121102/6d8faa74/attachment.html>
More information about the xdg
mailing list