diff options
author | Ken Moore <ken@pcbsd.org> | 2014-12-31 08:39:34 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2014-12-31 08:39:34 -0500 |
commit | 9ab36f494e3d6e4cc7f2e5a757ebda8842486c5b (patch) | |
tree | aa36841c8eef45368c9f0aee22a897efae92f800 /libLumina/LuminaXDG.cpp | |
parent | Clean up how translations are loaded for all the Lumina utilities, and also a... (diff) | |
download | lumina-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.cpp | 9 |
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; } |