# HG changeset patch # User Chris Cannam # Date 1294244420 0 # Node ID 478d0222e93d28f8a3c51e06e3b452b8b4f42f3c # Parent 90e70a9024f37204a859f08c3d6347e10c1f15f8 * Further findInPath fix for absolute paths diff -r 90e70a9024f3 -r 478d0222e93d common.cpp --- a/common.cpp Wed Jan 05 16:08:37 2011 +0000 +++ b/common.cpp Wed Jan 05 16:20:20 2011 +0000 @@ -59,10 +59,10 @@ name = QFileInfo(name).fileName(); QString path = QProcessEnvironment::systemEnvironment().value("PATH"); - DEBUG << "findExecutable: seeking location for binary " << name + DEBUG << "findInPath: seeking location for binary " << name << ": system path is " << path << endl; if (installPath != "") { - DEBUG << "findExecutable: install path is " << installPath + DEBUG << "findInPath: install path is " << installPath << ", adding to system path" << endl; //!!! path = path + pathSep + installPath; path = installPath + pathSep + path; @@ -77,17 +77,28 @@ foreach (QString element, elements) { QString full = QDir(element).filePath(name); QFileInfo fi(full); - DEBUG << "findExecutable: looking at " << full << endl; + DEBUG << "findInPath: looking at " << full << endl; if (fi.exists() && fi.isFile()) { - DEBUG << "findExecutable: it's a file" << endl; + DEBUG << "findInPath: it's a file" << endl; if (!executableRequired || fi.isExecutable()) { name = full; - DEBUG << "findExecutable: found at " << name << endl; + DEBUG << "findInPath: found at " << name << endl; found = true; break; } } } + } else { + // absolute path given + QFileInfo fi(name); + DEBUG << "findInPath: looking at absolute path " << name << endl; + if (fi.exists() && fi.isFile()) { + DEBUG << "findInPath: it's a file" << endl; + if (!executableRequired || fi.isExecutable()) { + DEBUG << "findInPath: found at " << name << endl; + found = true; + } + } } } #ifdef Q_OS_WIN32