C++: move post-sourceprocessing action into callback.

Change-Id: Iac6c9fe1ada27ac0d96417e490cc5723e6969541
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2014-06-06 14:41:19 +02:00
parent 528fa525bc
commit 13d2d499ab
8 changed files with 58 additions and 56 deletions

View File

@@ -160,6 +160,24 @@ QStringList CppModelManager::timeStampModifiedFiles(const QList<Document::Ptr> &
return sourceFiles;
}
/*!
* \brief createSourceProcessor Create a new source processor, which will signal the
* model manager when a document has been processed.
*
* Indexed file is truncated version of fully parsed document: copy of source
* code and full AST will be dropped when indexing is done.
*
* \return a new source processor object, which the caller needs to delete when finished.
*/
CppSourceProcessor *CppModelManager::createSourceProcessor()
{
CppModelManager *that = instance();
return new CppSourceProcessor(that->snapshot(), [=](const Document::Ptr &doc) {
that->emitDocumentUpdated(doc);
doc->releaseSourceAndAST();
});
}
void CppModelManager::updateModifiedSourceFiles()
{
const Snapshot snapshot = this->snapshot();