Quotes around the application name in .desktop files

Michael Spencer spencers1993 at gmail.com
Mon Apr 22 15:57:18 BST 2013


I noticed a bug in my application based on a template from KDevelop. When 
launched from Docky, single quotes are displayed around the application name 
in the title bar. After experimenting with the .desktop file, I found it is 
due to the quotes around the %c:

<appname> %i -caption "%c"

I removed the quotes, and the app worked fine, with the name still being 
passed as one argument, even though it had a space in it.

I checked some other KDE applications to see if this was just a bug in the 
KDevelop template, and found that Dolphin also has quotes, and when launched 
from Docky, draws single quotes around the name in the title bar.

According to the desktop entry spec (http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html):

"Field codes must not be used inside a quoted argument, the result of field 
code expansion inside a quoted argument is undefined."

I reported this as a bug in Dolphin, but was told that all KDE apps do this 
(KDE Bug #318593).

So, why do all the .desktop files for KDE put quotes around the app name, when 
they don't do anything, since the name is passed as one argument, even if it 
has a space in it? If I understand the part I quoted from the spec, this is 
incorrect, as it results in undefined behavior (and not so good behavior, as 
in the case of Docky). Is my understanding of this correct, and this is a bug 
in all .desktop files that do this?

Michael Spencer


More information about the kde-core-devel mailing list