forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user