C++: Cleanup: make the snapshot private in CppPreprocessor.

Change-Id: I69e892de34e06a0c95b3218abd8a0bb72966d875
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2013-02-26 14:53:32 +01:00
committed by Erik Verbruggen
parent 600f4438bb
commit 4e285a1186
3 changed files with 11 additions and 9 deletions

View File

@@ -282,17 +282,14 @@ namespace {
class Process: public std::unary_function<Document::Ptr, void>
{
QPointer<CppModelManager> _modelManager;
Snapshot _snapshot;
Document::Ptr _doc;
Document::CheckMode _mode;
public:
Process(QPointer<CppModelManager> modelManager,
Document::Ptr doc,
const Snapshot &snapshot,
const CppModelManager::WorkingCopy &workingCopy)
: _modelManager(modelManager),
_snapshot(snapshot),
_doc(doc),
_mode(Document::FastCheck)
{
@@ -319,6 +316,11 @@ void CppPreprocessor::run(const QString &fileName)
sourceNeeded(0, absoluteFilePath, IncludeGlobal);
}
void CppPreprocessor::removeFromCache(const QString &fileName)
{
m_snapshot.remove(fileName);
}
void CppPreprocessor::resetEnvironment()
{
m_env.reset();
@@ -601,8 +603,7 @@ void CppPreprocessor::sourceNeeded(unsigned line, QString &fileName, IncludeType
m_snapshot.insert(doc);
m_todo.remove(fileName);
Process process(m_modelManager, doc, m_snapshot, m_workingCopy);
Process process(m_modelManager, doc, m_workingCopy);
process();
(void) switchDocument(previousDoc);