Stop warnings on using QFileInfo without proper filename

* Stop warnings about using QFileInfo without a proper filename.

   Turns out that the filename of the project can still be empty
   when calling these methods from the new project wizard (before
   the first page is done).
This commit is contained in:
Tobias Hunger
2010-06-30 13:31:09 +02:00
parent dcd62a2a92
commit e033bd6ae7
2 changed files with 4 additions and 0 deletions

View File

@@ -793,6 +793,8 @@ QString Qt4Project::defaultTopLevelBuildDirectory() const
QString Qt4Project::defaultTopLevelBuildDirectory(const QString &profilePath)
{
if (profilePath.isEmpty())
return QString();
QFileInfo info(profilePath);
return QDir(projectDirectory(profilePath) + QLatin1String("/../") + info.baseName() + QLatin1String("-build")).absolutePath();
}