Commit 4cfaeb8b authored by Christian Kandeler's avatar Christian Kandeler
Browse files

QbsProjectManager: Fix crash when calling QbsProject::files().

We can't do that during parsing, as qbs::Project::buildSystemFiles()
might run into a race condition.

Change-Id: Iae3fd3000fdc71fec50c82d50fb3b4e3888351bc
Reviewed-by: default avatarJoerg Bornemann <>
parent 165f759e
...@@ -190,11 +190,11 @@ static void collectFilesForProject(const qbs::ProjectData &project, QSet<QString ...@@ -190,11 +190,11 @@ static void collectFilesForProject(const qbs::ProjectData &project, QSet<QString
QStringList QbsProject::files(Project::FilesMode fileMode) const QStringList QbsProject::files(Project::FilesMode fileMode) const
{ {
Q_UNUSED(fileMode); Q_UNUSED(fileMode);
if (!m_rootProjectNode || !m_rootProjectNode->qbsProjectData().isValid()) if (!m_qbsProject.isValid() || isParsing())
return QStringList(); return QStringList();
QSet<QString> result; QSet<QString> result;
collectFilesForProject(m_rootProjectNode->qbsProjectData(), result); collectFilesForProject(m_projectData, result);
result.unite(qbsProject().buildSystemFiles()); result.unite(m_qbsProject.buildSystemFiles());
return result.toList(); return result.toList();
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment