aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaUtils.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-05-25 09:30:43 -0400
committerKen Moore <ken@pcbsd.org>2015-05-25 09:30:43 -0400
commit172b7e4565384da84ad3e572caf47596c36ad9f1 (patch)
tree121436130d5c671c55d31ea38c8a869e179e5d99 /libLumina/LuminaUtils.cpp
parentMove the desktop initialization after the menu's initialization. With all teh... (diff)
downloadlumina-172b7e4565384da84ad3e572caf47596c36ad9f1.tar.gz
lumina-172b7e4565384da84ad3e572caf47596c36ad9f1.tar.bz2
lumina-172b7e4565384da84ad3e572caf47596c36ad9f1.zip
Add the ability to show binaries on the lumina-search output as well as *.desktop files.
Diffstat (limited to 'libLumina/LuminaUtils.cpp')
-rw-r--r--libLumina/LuminaUtils.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp
index aa2336e3..6660f65c 100644
--- a/libLumina/LuminaUtils.cpp
+++ b/libLumina/LuminaUtils.cpp
@@ -87,7 +87,7 @@ bool LUtils::writeFile(QString filepath, QStringList contents, bool overwrite){
return ok;
}
-bool LUtils::isValidBinary(QString bin){
+bool LUtils::isValidBinary(QString& bin){
if(!bin.startsWith("/")){
//Relative path: search for it on the current "PATH" settings
QStringList paths = QString(qgetenv("PATH")).split(":");
@@ -98,7 +98,9 @@ bool LUtils::isValidBinary(QString bin){
//bin should be the full path by now
if(!bin.startsWith("/")){ return false; }
QFileInfo info(bin);
- return (info.exists() && info.isExecutable());
+ bool good = (info.exists() && info.isExecutable());
+ if(good){ bin = info.absoluteFilePath(); }
+ return good;
}
QStringList LUtils::listSubDirectories(QString dir, bool recursive){
bgstack15