From 9ab36f494e3d6e4cc7f2e5a757ebda8842486c5b Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 31 Dec 2014 08:39:34 -0500 Subject: Be a little bit more careful about the handling of the "Exec=" field codes in *.desktop files. This seems to fix the occasional issue with KDE *.desktop shotcuts (okular in particular). --- libLumina/LuminaXDG.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libLumina/LuminaXDG.cpp') diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp index b58f4326..3940da11 100644 --- a/libLumina/LuminaXDG.cpp +++ b/libLumina/LuminaXDG.cpp @@ -254,9 +254,12 @@ QString LXDG::getDesktopExec(XDGDesktop app){ out = app.exec; } //Now perform any of the XDG flag substitutions as appropriate (9/2014 standards) - if(out.contains(" %i ")){ out.replace(" %i ", " --icon "+app.icon+" "); } - if(out.contains(" %c ")){ out.replace(" %c ", " "+app.name+" "); } - if(out.contains(" %k ")){ out.replace(" %k ", " "+app.filePath+" "); } + if(out.contains("%i")){ out.replace("%i", "--icon \'"+app.icon+"\'"); } + if(out.contains("%c")){ + if(!app.name.isEmpty()){ out.replace("%c", ""+app.name+""); } + else if(!app.genericName.isEmpty()){ out.replace(" %c ", ""+app.genericName+""); } + } + if(out.contains("%k")){ out.replace("%k", "\'"+app.filePath+"\'"); } return out; } -- cgit