Bug 262367 - Klipper malhandles commands for default file type actions
Summary: Klipper malhandles commands for default file type actions
Alias: None
Product: klipper
Classification: Applications
Component: general (show other bugs)
Version: 0.9.6
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Esben Mose Hansen
Depends on:
Reported: 2011-01-07 04:12 UTC by Frank Steinmetzger
Modified: 2011-12-25 18:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.0
Sentry Crash Report:


Note You need to log in before you can comment on or make changes to this bug.
Description Frank Steinmetzger 2011-01-07 04:12:10 UTC
Version:           0.9.6 (using KDE 4.5.90) 
OS:                Linux

On my system the default Okular handler for PDFs is the command
okular %U %i -caption "%c"
This is the vanilla setting, I can’t remember ever having changed that. Plus, this system was freshly installed less than two months ago.

Klipper does not handle this properly, as it opens two Okular windows. Example: I Ctrl+C a PDF file in Krusader/Dolphin, the clipboarded string is file:///path/to/some.pdf. The menu pops up and I select Okular. Now I get two empty Okular windows, with the Window titles %c and %c (2) respectively.
One says "/home/frank/Dokumente/%i could not be opened.", the other says "/path/to/some.pdf could not be opened." /home/frank/Dokumente/ is set as my documents folder in my personal settings.

If I open /usr/share/texmf-dist/doc/latex/pdfpages/pdfpages.pdf (copied from a locate search result in a terminal), I get two windows as well, but only one is empty, the other one shows the file, with the window title "The pdfpages Package - %c". For comparison: opening the file normally via $filemanager, the window title reads "The pdfpages Package - Okular".

So the file:// URI is another problem here.

Reproducible: Always

Steps to Reproduce:
Copy a file or URL to the clipboard and, from the Klipper popup, select an action that is associated with the file type.

Actual Results:  
Multiple windows open, of which only one opens the file, the other one gives error messages due to additional parameters in the selected open command.

Expected Results:  
Only one window should open and then process the selected file, the parameters should be either correctly dispatched or ignored if the former is not possible.

I’ve been observing this problem for a long time now, it must go back to at least 4.4, quite possibly even farther.

PS.: My Klipper version is 0.97, KDE is at version 4.6 RC2 (both are not listed in the version dropdown).
Comment 1 Jekyll Wu 2011-12-14 14:19:20 UTC
I think the problem is Klipper does not expand "%i" and "%c". According to freedesktop specification, "%i" is supposed to be expanded to "--icon <Icon>" and "%c" is supposed to be expanded to "<Name>".
Comment 2 Jekyll Wu 2011-12-14 14:20:35 UTC
*** Bug 253366 has been marked as a duplicate of this bug. ***
Comment 3 Jekyll Wu 2011-12-25 18:26:41 UTC
Fixed by commit 45be8bcb3319a05305c19f9a9a6b18b611f6f6f3.