From 172b7e4565384da84ad3e572caf47596c36ad9f1 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 25 May 2015 09:30:43 -0400 Subject: Add the ability to show binaries on the lumina-search output as well as *.desktop files. --- libLumina/LuminaUtils.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libLumina/LuminaUtils.cpp') 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){ -- cgit