qmljs: fix race in qmljstodoitemsscanner

avoid calling ui-only method on the ProjectExplorer::Project,
use information cached in ProjectInfo instead.
This (as before) does not automatically scans files in qrc.
Contents of qrc should most likely be added to ProjectInfo.sourceFiles

Task-number: QTCREATORBUG-12556
Change-Id: Ic7f72589cc5bb132ef9d3d03be9d9fc47f1196fd
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
Fawzi Mohamed
2014-06-30 14:57:42 +02:00
parent d2e5447630
commit 817d02d113

View File

@@ -47,7 +47,7 @@ bool QmlJsTodoItemsScanner::shouldProcessFile(const QString &fileName)
{ {
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance(); QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
foreach (const QmlJS::ModelManagerInterface::ProjectInfo &info, modelManager->projectInfos()) foreach (const QmlJS::ModelManagerInterface::ProjectInfo &info, modelManager->projectInfos())
if (info.project->files(ProjectExplorer::Project::ExcludeGeneratedFiles).contains(fileName)) if (info.sourceFiles.contains(fileName))
return true; return true;
return false; return false;