From 12f43f60d18613d57cc6c1868aa58ed2290323e3 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 7 Mar 2017 00:29:41 +0100 Subject: [PATCH] Check isFile in order not to find usr/share/appname https://travis-ci.org/probonopd/QOwnNotes/builds/208396925 --- linuxdeployqt/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linuxdeployqt/main.cpp b/linuxdeployqt/main.cpp index d13eb08..a4c124d 100644 --- a/linuxdeployqt/main.cpp +++ b/linuxdeployqt/main.cpp @@ -100,7 +100,7 @@ int main(int argc, char **argv) QDirIterator it(directoryToBeSearched, QDirIterator::Subdirectories); while (it.hasNext()) { it.next(); - if((it.fileName() == desktopExecEntry) && (it.fileInfo().isExecutable())){ + if((it.fileName() == desktopExecEntry) && (it.fileInfo().isFile()) && (it.fileInfo().isExecutable())){ qDebug() << "Found binary from desktop file:" << it.fileInfo().canonicalFilePath(); appBinaryPath = it.fileInfo().absoluteFilePath(); break; @@ -117,7 +117,7 @@ int main(int argc, char **argv) QDirIterator it2(directoryToBeSearched, QDirIterator::Subdirectories); while (it2.hasNext()) { it2.next(); - if((it2.fileName() == desktopExecEntry) && (it2.fileInfo().isExecutable())){ + if((it2.fileName() == desktopExecEntry) && (it.fileInfo().isFile()) && (it2.fileInfo().isExecutable())){ qDebug() << "Found binary from desktop file:" << it2.fileInfo().canonicalFilePath(); appBinaryPath = it2.fileInfo().absoluteFilePath(); break; @@ -126,7 +126,7 @@ int main(int argc, char **argv) } if(appBinaryPath == ""){ - if(QFileInfo(candidateBin).isExecutable()) { + if((QFileInfo(candidateBin).isFile()) && (QFileInfo(candidateBin).isExecutable())) { appBinaryPath = QFileInfo(candidateBin).absoluteFilePath(); } else { LogError() << "Could not determine the path to the executable based on the desktop file\n";