Designer/CppTools: Fix flaky test_gotoslot_withoutProject

The document was not always updated in time.

Change-Id: Iac89985d39a8784e3cbf63dfd42b1c5150775068
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-11-13 14:31:50 +01:00
parent 8a1eed2c56
commit 36ce1dbb84
4 changed files with 27 additions and 7 deletions

View File

@@ -461,7 +461,7 @@ CppEditorSupport *CppModelManager::cppEditorSupport(TextEditor::BaseTextEditor *
QMutexLocker locker(&m_cppEditorSupportsMutex);
CppEditorSupport *editorSupport = m_cppEditorSupports.value(textEditor, 0);
if (!editorSupport) {
if (!editorSupport && isCppEditor(textEditor)) {
editorSupport = new CppEditorSupport(this, textEditor);
m_cppEditorSupports.insert(textEditor, editorSupport);
}

View File

@@ -308,6 +308,11 @@ void CppEditorSupport::updateDocumentNow()
}
}
bool CppEditorSupport::isUpdatingDocument()
{
return m_updateDocumentTimer->isActive() || m_documentParser.isRunning();
}
void CppEditorSupport::onDocumentUpdated(Document::Ptr doc)
{
if (doc.isNull())

View File

@@ -125,6 +125,9 @@ public:
QSharedPointer<SnapshotUpdater> snapshotUpdater();
/// Checks whether the document is (re)parsed or about to be (re)parsed.
bool isUpdatingDocument();
signals:
void documentUpdated();
void diagnosticsChanged();