! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar does not respect %f for "robust" (.desktop) actions
Status:
RESOLVED: MOVED

Comments

Description Khazar 2012-10-19 12:42:21 CEST
Created attachment 4673 
A .desktop file of Xfmedia

I am using Xfmedia which has two .desktop actions included.

[Desktop Entry]
...
Name=Xfmedia
Comment=Lightweight Media Player
Exec=xfmedia %F
...
Actions=Enqueue;Enqueue and Play;

[Desktop Action Enqueue]
Exec=xfmedia-remote -a %f
Name=Enqueue in Xfmedia

[Desktop Action Enqueue and Play]
Exec=xfmedia-remote -p -a %f
Name=Enqueue and play with Xfmedia


While lower-case indicates of selections of one item, upper-case indicates of selection of multiple items.

%f the path of the first selected file
%F the paths to all selected files

Thunar does not distinguish cases.

According to the desktop file of Xfmedia, on selection of several files, only Open with "Xfmedia" should appear and the robust action entries "Enqueue in Xfmedia" and "Enqueue and play with Xfmedia" should not.  This is exactly how the appearance of actions managed in Custom Actions is occurring as there is a segregation for %f and %F for Custom Actions.
Comment 1 Khazar 2012-10-19 13:39:23 CEST
I forgot to mention that Send To DOES respect %f and entries with %f will not appear in the Send To menu for selection of several files.


Example:

[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
Name=Bluetooth Device
Icon=blueman
Exec=blueman-sendto %f
Comment 2 Nick Schermer editbugs 2012-10-24 15:13:00 CEST
It is also allowed to spawn the command > 1 with %f.
Comment 3 Khazar 2012-10-25 13:34:59 CEST
Here is a related issue in which a developer confused %u with %U and, as a result, if one tries to open several files, the files will be opened in different instances instead of one (embarrassing) <https://mail.gna.org/public/whaawmp-dev/2011-11/msg00027.html> (this is about to be corrected, soon <https://mail.gna.org/public/whaawmp-dev/2012-10/msg00007.html>).

So if one intends to add a .desktop action for *a file* to software, the users should have this action appear for a selection of one file only, otherwise, bad results may occur.

> It is also allowed to spawn the command > 1 with %f.
a. Send To or context-menu actions?
b. By writing "the command > 1 with %f", did you meant to the situation I presented at the top of my comment? (that I am writing "now")
Comment 4 Khazar 2013-01-06 08:04:07 CET
> I forgot to mention that Send To DOES respect %f and entries
> with %f will not appear in the Send To menu for selection of
> several files.
> 
> 
> Example:

SendTo of Thunar 1.4.0 does not respect %f and now entries with %f
will appear in the Send To menu for selection of several files.
Comment 5 Khazar 2013-07-13 07:27:53 CEST
Code: %f ; Description: A single file name, even if multiple files are selected. The system reading the desktop entry should recognize that the program in question cannot handle multiple file arguments, and it should probably spawn and execute multiple copies of a program for each selected file if the program is not able to handle additional file arguments.

From: http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
Comment 6 Git Bot editbugs 2020-05-26 23:12:48 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/thunar/-/issues/45.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #9386

Reported by:
Khazar
Reported on: 2012-10-19
Last modified on: 2020-05-26

People

Assignee:
Jannis Pohlmann
CC List:
1 user

Version

Attachments

A .desktop file of Xfmedia (1.31 KB, application/octet-stream)
2012-10-19 12:42 CEST , Khazar
no flags

Additional information