Fix finding specs in the unsupported/ directory.

The -spec argument was interpreted as a relative directory as
soon as it contained a slash. Fix this by checking if the
directory exists before attempting to interpret it.

Change-Id: Ide8f0418abc719b0be582d2d72642a141f6c6dea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Thomas McGuire 2012-03-06 13:13:09 +01:00 committed by Qt by Nokia
parent 3ff7bc086b
commit 11f9d18731

View File

@ -149,8 +149,11 @@ static QString detectProjectFile(const QString &path)
static QString cleanSpec(const QString &spec)
{
QString ret = QDir::cleanPath(spec);
if (ret.contains('/'))
ret = QDir::cleanPath(QFileInfo(ret).absoluteFilePath());
if (ret.contains('/')) {
const QFileInfo specDirInfo(ret);
if (specDirInfo.exists() && specDirInfo.isDir())
ret = QDir::cleanPath(specDirInfo.absoluteFilePath());
}
return ret;
}