forked from qt-creator/qt-creator
		
	CppEditor: Avoid premature calls to recalculateSemanticInfoNow
Now recalculateSemanticInfoNow is called only once instead of three times when a new editor is opened/created. Change-Id: Ife84fc9ca90cdbf2a417123e6a2b9e1e068dfdc4 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
		| @@ -175,6 +175,11 @@ void CppEditorSupport::setExtraDiagnostics(const QString &key, | ||||
|     emit diagnosticsChanged(); | ||||
| } | ||||
|  | ||||
| bool CppEditorSupport::initialized() | ||||
| { | ||||
|     return m_initialized; | ||||
| } | ||||
|  | ||||
| SemanticInfo CppEditorSupport::recalculateSemanticInfo(bool emitSignalWhenFinished) | ||||
| { | ||||
|     m_futureSemanticInfo.cancel(); | ||||
| @@ -186,6 +191,11 @@ SemanticInfo CppEditorSupport::recalculateSemanticInfo(bool emitSignalWhenFinish | ||||
|  | ||||
| void CppEditorSupport::recalculateSemanticInfoDetached(bool force) | ||||
| { | ||||
|     // Block premature calculation caused by CppEditorPlugin::currentEditorChanged | ||||
|     // when the editor is created. | ||||
|     if (!m_initialized) | ||||
|         return; | ||||
|  | ||||
|     m_futureSemanticInfo.cancel(); | ||||
|     SemanticInfo::Source source = currentSource(force); | ||||
|     m_futureSemanticInfo = QtConcurrent::run<CppEditorSupport, void>( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user