aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaXDG.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-12-31 08:39:34 -0500
committerKen Moore <ken@pcbsd.org>2014-12-31 08:39:34 -0500
commit9ab36f494e3d6e4cc7f2e5a757ebda8842486c5b (patch)
treeaa36841c8eef45368c9f0aee22a897efae92f800 /libLumina/LuminaXDG.cpp
parentClean up how translations are loaded for all the Lumina utilities, and also a... (diff)
downloadlumina-9ab36f494e3d6e4cc7f2e5a757ebda8842486c5b.tar.gz
lumina-9ab36f494e3d6e4cc7f2e5a757ebda8842486c5b.tar.bz2
lumina-9ab36f494e3d6e4cc7f2e5a757ebda8842486c5b.zip
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).
Diffstat (limited to 'libLumina/LuminaXDG.cpp')
-rw-r--r--libLumina/LuminaXDG.cpp9
1 files changed, 6 insertions, 3 deletions
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;
}
bgstack15