Check isFile in order not to find usr/share/appname
https://travis-ci.org/probonopd/QOwnNotes/builds/208396925
This commit is contained in:
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
|
|||||||
QDirIterator it(directoryToBeSearched, QDirIterator::Subdirectories);
|
QDirIterator it(directoryToBeSearched, QDirIterator::Subdirectories);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
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();
|
qDebug() << "Found binary from desktop file:" << it.fileInfo().canonicalFilePath();
|
||||||
appBinaryPath = it.fileInfo().absoluteFilePath();
|
appBinaryPath = it.fileInfo().absoluteFilePath();
|
||||||
break;
|
break;
|
||||||
@@ -117,7 +117,7 @@ int main(int argc, char **argv)
|
|||||||
QDirIterator it2(directoryToBeSearched, QDirIterator::Subdirectories);
|
QDirIterator it2(directoryToBeSearched, QDirIterator::Subdirectories);
|
||||||
while (it2.hasNext()) {
|
while (it2.hasNext()) {
|
||||||
it2.next();
|
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();
|
qDebug() << "Found binary from desktop file:" << it2.fileInfo().canonicalFilePath();
|
||||||
appBinaryPath = it2.fileInfo().absoluteFilePath();
|
appBinaryPath = it2.fileInfo().absoluteFilePath();
|
||||||
break;
|
break;
|
||||||
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(appBinaryPath == ""){
|
if(appBinaryPath == ""){
|
||||||
if(QFileInfo(candidateBin).isExecutable()) {
|
if((QFileInfo(candidateBin).isFile()) && (QFileInfo(candidateBin).isExecutable())) {
|
||||||
appBinaryPath = QFileInfo(candidateBin).absoluteFilePath();
|
appBinaryPath = QFileInfo(candidateBin).absoluteFilePath();
|
||||||
} else {
|
} else {
|
||||||
LogError() << "Could not determine the path to the executable based on the desktop file\n";
|
LogError() << "Could not determine the path to the executable based on the desktop file\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user