Make sure we do not get "//" in the QMake path

Task-number: QTCREATORBUG-2990
This commit is contained in:
Tobias Hunger
2010-11-08 11:28:54 +01:00
parent 00a9766408
commit b7796bf309

View File

@@ -48,8 +48,11 @@ QString BuildableHelperLibrary::findSystemQt(const Utils::Environment &env)
{ {
QStringList paths = env.path(); QStringList paths = env.path();
foreach (const QString &path, paths) { foreach (const QString &path, paths) {
QString prefix = path;
if (!prefix.endsWith(QLatin1Char('/')))
prefix.append(QLatin1Char('/'));
foreach (const QString &possibleCommand, possibleQMakeCommands()) { foreach (const QString &possibleCommand, possibleQMakeCommands()) {
const QFileInfo qmake(path + QLatin1Char('/') + possibleCommand); const QFileInfo qmake(prefix + possibleCommand);
if (qmake.exists()) { if (qmake.exists()) {
if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull()) { if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull()) {
return qmake.absoluteFilePath(); return qmake.absoluteFilePath();