diff options
author | Ken Moore <moorekou@gmail.com> | 2014-09-16 06:32:10 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2014-09-16 06:32:10 -0400 |
commit | 1dc625c016fee42c7299c4a83e3cded80696c616 (patch) | |
tree | 6c9cf48047c5396cdf4baa873dd8d42305d1cd75 /libLumina/LuminaXDG.cpp | |
parent | Update the Lumina user button a bit: (diff) | |
parent | Updated fix to make sure first Exec entry in a .desktop file is taken. (diff) | |
download | lumina-1dc625c016fee42c7299c4a83e3cded80696c616.tar.gz lumina-1dc625c016fee42c7299c4a83e3cded80696c616.tar.bz2 lumina-1dc625c016fee42c7299c4a83e3cded80696c616.zip |
Merge pull request #9 from slicer69/master
Launch default application represented by icon on Linux
Diffstat (limited to 'libLumina/LuminaXDG.cpp')
-rw-r--r-- | libLumina/LuminaXDG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp index e84c081e..3b489487 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 @@ -58,8 +59,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.isEmpty()) ) { DF.tryexec = val; } + else if( (var=="Exec") && (DF.exec.isEmpty() ) ) { 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); } |