CppTools: Do not hand over partly reloaded files to the code model

When a reloading operation was in progress, CppEditorSupport::contents()
could return a partly reloaded file to the code model leading to parse
errors and incomplete highlighting.

Fixed by checking if the file is currently being reloaded.

Task-number: QTCREATORBUG-9382

Change-Id: Iee97e10444763c0cbf481132afa4617c5cdbd15c
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-06-18 16:26:40 +02:00
parent 10ff6769ac
commit 6df66e883f
2 changed files with 29 additions and 3 deletions

View File

@@ -121,6 +121,9 @@ signals:
private slots:
void onMimeTypeChanged();
void onAboutToReload();
void onReloadFinished();
void updateDocument();
void updateDocumentNow();
@@ -166,6 +169,7 @@ private:
// content caching
mutable QString m_cachedContents;
mutable int m_cachedContentsEditorRevision;
bool m_fileIsBeingReloaded;
QTimer *m_updateEditorTimer;
EditorUpdates m_editorUpdates;