forked from qt-creator/qt-creator
		
	CppTools: Save some stats by using correct include paths
..while initial parsing. Change-Id: I202da3f4f9e445a28e9726352fc005488efe2893 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
		@@ -47,6 +47,8 @@ static void parse(QFutureInterface<void> &future,
 | 
			
		||||
    const QString conf = CppModelManagerInterface::configurationFileName();
 | 
			
		||||
    bool processingHeaders = false;
 | 
			
		||||
 | 
			
		||||
    CppModelManager *cmm = CppModelManager::instance();
 | 
			
		||||
    const QStringList fallbackIncludePaths = cmm->includePaths();
 | 
			
		||||
    for (int i = 0; i < files.size(); ++i) {
 | 
			
		||||
        if (future.isPaused())
 | 
			
		||||
            future.waitForResume();
 | 
			
		||||
@@ -65,6 +67,11 @@ static void parse(QFutureInterface<void> &future,
 | 
			
		||||
            processingHeaders = true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        QList<ProjectPart::Ptr> parts = cmm->projectPart(fileName);
 | 
			
		||||
        QStringList includePaths = parts.isEmpty()
 | 
			
		||||
                ? fallbackIncludePaths
 | 
			
		||||
                : parts.first()->includePaths;
 | 
			
		||||
        preproc->setIncludePaths(includePaths);
 | 
			
		||||
        preproc->run(fileName);
 | 
			
		||||
 | 
			
		||||
        future.setProgressValue(files.size() - preproc->todo().size());
 | 
			
		||||
 
 | 
			
		||||
@@ -802,6 +802,7 @@ ProjectPart::Ptr CppModelManager::projectPartForProjectFile(const QString &proje
 | 
			
		||||
 | 
			
		||||
QList<ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) const
 | 
			
		||||
{
 | 
			
		||||
    QMutexLocker locker(&m_projectMutex);
 | 
			
		||||
    return m_fileToProjectParts.value(fileName);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user