From e033bd6ae7f4bdaf9bf87b8345fc7ac12109f8f3 Mon Sep 17 00:00:00 2001 From: Tobias Hunger <tobias.hunger@nokia.com> Date: Wed, 30 Jun 2010 13:31:09 +0200 Subject: [PATCH] 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). --- src/plugins/projectexplorer/project.cpp | 2 ++ src/plugins/qt4projectmanager/qt4project.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index bdea6c9ef2b..12c47ee454b 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -234,6 +234,8 @@ QString Project::projectDirectory() const QString Project::projectDirectory(const QString &proFile) { + if (proFile.isEmpty()) + return QString(); QFileInfo info(proFile); return info.absoluteDir().path(); } diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index c56abe40fb5..3e42ca965e8 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -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(); } -- GitLab