Suppress "file outside the project" warning when there is no project

Change-Id: I46f6e38ba167a85b17ae9f7ac89d5fbbc75abfcd
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2014-12-26 10:15:10 +02:00
committed by Orgad Shaneh
parent 9007d2cb33
commit 384641d798

View File

@@ -334,7 +334,10 @@ void ProjectTree::updateExternalFileWarning()
if (!infoBar->canInfoBeAdded(externalFileId))
return;
Utils::FileName fileName = Utils::FileName::fromString(document->filePath());
foreach (Project *project, SessionManager::projects()) {
const QList<Project *> projects = SessionManager::projects();
if (projects.isEmpty())
return;
foreach (Project *project, projects) {
Utils::FileName projectDir = project->projectDirectory();
if (projectDir.isEmpty())
continue;