From cacd66195c1e37cf89023ffce82a69d135c6d734 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Mon, 6 May 2013 14:59:15 +0200 Subject: 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 --- src/plugins/cpptools/cpptoolseditorsupport.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/plugins/cpptools/cpptoolseditorsupport.h') diff --git a/src/plugins/cpptools/cpptoolseditorsupport.h b/src/plugins/cpptools/cpptoolseditorsupport.h index d7534f33e2..2a027eabf0 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.h +++ b/src/plugins/cpptools/cpptoolseditorsupport.h @@ -98,12 +98,17 @@ public: void setExtraDiagnostics(const QString &key, const QList &messages); + /// True after the document was parsed/updated for the first time + /// and the first semantic info calculation was started. + bool initialized(); + /// Retrieve the semantic info, which will get recalculated on the current /// thread if it is outdate. SemanticInfo recalculateSemanticInfo(bool emitSignalWhenFinished = true); - /// Recalculates the semantic info in a future, and will emit the semanticInfoUpdated() signal - /// when finished. + /// Recalculates the semantic info in a future, and will emit the + /// semanticInfoUpdated() signal when finished. + /// Requires that initialized() is true. /// \param force do not check if the old semantic info is still valid void recalculateSemanticInfoDetached(bool force = false); -- cgit v1.2.1