Commit 60f9046d authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppTools: Save some stats by using correct include paths

..while initial parsing.

Change-Id: I202da3f4f9e445a28e9726352fc005488efe2893
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 7c0bb193
......@@ -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);
}
......
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