CppTools: Remove a QTC_ASSERT

Triggering the action "Rename Symbol Under Cursor" before the
SnapshotUpdater::update() call in parse() of cpptoolseditorsupport.cpp
led to the failing assertion.

Triggering the action in the initialization phase of the editor is not
supported, therefore replace the assert with a silent if.

Change-Id: Ib911b8aa038ae3d9ea28c720853780b11dfa0fb7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-07-07 16:34:34 +02:00
parent b70377c872
commit 170389cf40

View File

@@ -526,7 +526,8 @@ SemanticInfo CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::So
const QSharedPointer<SnapshotUpdater> snapshotUpdater = snapshotUpdater_internal();
QTC_ASSERT(snapshotUpdater, return newSemanticInfo);
newSemanticInfo.snapshot = snapshotUpdater->snapshot();
QTC_ASSERT(newSemanticInfo.snapshot.contains(source.fileName), return newSemanticInfo);
if (!newSemanticInfo.snapshot.contains(source.fileName))
return newSemanticInfo; // SnapshotUpdater::update() not yet started.
Document::Ptr doc = newSemanticInfo.snapshot.preprocessedDocument(source.code,
source.fileName);
if (processor)