forked from qt-creator/qt-creator
Use the text editor revision to ignore outdated parse results.
This commit is contained in:
@@ -111,7 +111,8 @@ private:
|
||||
Document::Document(const QString &fileName)
|
||||
: _fileName(QDir::cleanPath(fileName)),
|
||||
_globalNamespace(0),
|
||||
_revision(0)
|
||||
_revision(0),
|
||||
_editorRevision(0)
|
||||
{
|
||||
_control = new Control();
|
||||
|
||||
@@ -148,6 +149,16 @@ void Document::setRevision(unsigned revision)
|
||||
_revision = revision;
|
||||
}
|
||||
|
||||
unsigned Document::editorRevision() const
|
||||
{
|
||||
return _editorRevision;
|
||||
}
|
||||
|
||||
void Document::setEditorRevision(unsigned editorRevision)
|
||||
{
|
||||
_editorRevision = editorRevision;
|
||||
}
|
||||
|
||||
QDateTime Document::lastModified() const
|
||||
{
|
||||
return _lastModified;
|
||||
@@ -489,6 +500,7 @@ Document::Ptr Snapshot::documentFromSource(const QByteArray &preprocessedCode,
|
||||
|
||||
if (Document::Ptr thisDocument = document(fileName)) {
|
||||
newDoc->_revision = thisDocument->_revision;
|
||||
newDoc->_editorRevision = thisDocument->_editorRevision;
|
||||
newDoc->_lastModified = thisDocument->_lastModified;
|
||||
newDoc->_includes = thisDocument->_includes;
|
||||
newDoc->_definedMacros = thisDocument->_definedMacros;
|
||||
|
||||
@@ -60,6 +60,9 @@ public:
|
||||
unsigned revision() const;
|
||||
void setRevision(unsigned revision);
|
||||
|
||||
unsigned editorRevision() const;
|
||||
void setEditorRevision(unsigned editorRevision);
|
||||
|
||||
QDateTime lastModified() const;
|
||||
void setLastModified(const QDateTime &lastModified);
|
||||
|
||||
@@ -312,6 +315,7 @@ private:
|
||||
QByteArray _source;
|
||||
QDateTime _lastModified;
|
||||
unsigned _revision;
|
||||
unsigned _editorRevision;
|
||||
|
||||
friend class Snapshot;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user