Clang: Use revision from file container

Change-Id: Ie084677fb910fc6e415afcdf7533369150162f8f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-12-01 14:02:39 +01:00
parent ea278cdf34
commit ff913b83ae

View File

@@ -512,12 +512,13 @@ CppTools::CppEditorDocumentHandle *cppDocument(const QString &filePath)
return CppTools::CppModelManager::instance()->cppEditorDocument(filePath); return CppTools::CppModelManager::instance()->cppEditorDocument(filePath);
} }
bool documentHasChanged(const QString &filePath) bool documentHasChanged(const QString &filePath,
uint revision)
{ {
auto *document = cppDocument(filePath); auto *document = cppDocument(filePath);
if (document) if (document)
return document->sendTracker().shouldSendRevision(document->revision()); return document->sendTracker().shouldSendRevision(revision);
return true; return true;
} }
@@ -562,7 +563,7 @@ void IpcCommunicator::updateTranslationUnitWithRevisionCheck(const FileContainer
if (m_sendMode == IgnoreSendRequests) if (m_sendMode == IgnoreSendRequests)
return; return;
if (documentHasChanged(fileContainer.filePath())) { if (documentHasChanged(fileContainer.filePath(), fileContainer.documentRevision())) {
updateTranslationUnitsForEditor({fileContainer}); updateTranslationUnitsForEditor({fileContainer});
setLastSentDocumentRevision(fileContainer.filePath(), setLastSentDocumentRevision(fileContainer.filePath(),
fileContainer.documentRevision()); fileContainer.documentRevision());