aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaXDG.cpp
diff options
context:
space:
mode:
authorJesse Smith <jessefrgsmith@yahoo.ca>2014-09-15 19:45:18 -0300
committerJesse Smith <jessefrgsmith@yahoo.ca>2014-09-15 19:45:18 -0300
commitf9a2bf7f0d5c9b4acdd0ac65e6638d9729e9c783 (patch)
treedc170241a1a4267b59a7c3231a2b0115d95d86ed /libLumina/LuminaXDG.cpp
parentUpdate lumina-config to use the new OS prefix settings. (diff)
downloadlumina-f9a2bf7f0d5c9b4acdd0ac65e6638d9729e9c783.tar.gz
lumina-f9a2bf7f0d5c9b4acdd0ac65e6638d9729e9c783.tar.bz2
lumina-f9a2bf7f0d5c9b4acdd0ac65e6638d9729e9c783.zip
Select the first exec entry from a .desktop file rather than the last.
Fixes some launch problems on icons with multiple potential launch paths on Linux.
Diffstat (limited to 'libLumina/LuminaXDG.cpp')
-rw-r--r--libLumina/LuminaXDG.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp
index 3bbc32f9..7934c924 100644
--- a/libLumina/LuminaXDG.cpp
+++ b/libLumina/LuminaXDG.cpp
@@ -20,6 +20,7 @@ XDGDesktop LXDG::loadDesktopFile(QString filePath, bool& ok){
DF.startupNotify=false;
DF.type = XDGDesktop::BAD;
DF.filePath = filePath;
+ DF.exec = DF.tryexec = ""; // just to make sure this is initialized
//Check input file path validity
QFile file(filePath);
if(!file.exists()){ return DF; } //invalid file
@@ -53,8 +54,8 @@ XDGDesktop LXDG::loadDesktopFile(QString filePath, bool& ok){
if(DF.icon.isEmpty() && loc.isEmpty()){ DF.icon = val; }
else if(loc == lang){ DF.icon = val; }
}
- else if(var=="TryExec"){ DF.tryexec = val; }
- else if(var=="Exec"){ DF.exec = val; }
+ else if( (var=="TryExec") && (DF.tryexec != "") ) { DF.tryexec = val; }
+ else if( (var=="Exec") && (DF.exec != "") ){ DF.exec = val; } // only take the first Exec command in the file
else if(var=="NoDisplay" && !DF.isHidden){ DF.isHidden = (val.toLower()=="true"); }
else if(var=="Hidden" && !DF.isHidden){ DF.isHidden = (val.toLower()=="true"); }
else if(var=="Categories"){ DF.catList = val.split(";",QString::SkipEmptyParts); }
bgstack15