diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-05-06 14:59:15 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-05-07 11:45:46 +0200 |
commit | cacd66195c1e37cf89023ffce82a69d135c6d734 (patch) | |
tree | bbac720894ec37243bcdd490681261e31d63d546 /src/plugins/cpptools/cpptoolseditorsupport.h | |
parent | 7313203c2934f0a041067ef1f263b2bb323b2fbd (diff) | |
download | qt-creator-cacd66195c1e37cf89023ffce82a69d135c6d734.tar.gz |
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>
Diffstat (limited to 'src/plugins/cpptools/cpptoolseditorsupport.h')
-rw-r--r-- | src/plugins/cpptools/cpptoolseditorsupport.h | 9 |
1 files changed, 7 insertions, 2 deletions
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<CPlusPlus::Document::DiagnosticMessage> &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); |