Commit a8466058 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Environment: Support absolute file path without extension on Windows



Change-Id: I86045a4cd8a279ed0ee08730a6e8da2672884b09
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent b1d7d806
......@@ -238,8 +238,6 @@ QString Environment::searchInPath(const QString &executable,
{
QString exec = QDir::cleanPath(expandVariables(executable));
QFileInfo fi(exec);
if (fi.isAbsolute())
return exec;
if (executable.isEmpty())
return QString();
......@@ -251,11 +249,21 @@ QString Environment::searchInPath(const QString &executable,
if (fi.suffix().isEmpty()) {
QStringList extensions = value(QLatin1String("PATHEXT")).split(QLatin1Char(';'));
foreach (const QString &ext, extensions)
execs << executable + ext.toLower();
foreach (const QString &ext, extensions) {
QString tmp = executable + ext.toLower();
if (fi.isAbsolute()) {
if (QFile::exists(tmp))
return tmp;
} else {
execs << tmp;
}
}
}
}
if (fi.isAbsolute())
return exec;
foreach (const QString &dir, additionalDirs) {
QString tmp = searchInDirectory(execs, dir);
if (!tmp.isEmpty())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment