QmlLivePreview: Don't use EditorManager::openedEditors.

It doesn't do what one'd think it should, and will be removed.

Change-Id: I5f496388854913d1b968a5e0ffe6eaa5ca1430f0
Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
This commit is contained in:
Eike Ziller
2013-07-17 14:05:05 +02:00
parent 5563604876
commit db2977531b

View File

@@ -457,8 +457,15 @@ void QmlInspectorAdapter::initializePreviews()
}
// initial update
foreach (Core::IEditor *editor, em->openedEditors())
createPreviewForEditor(editor);
Core::DocumentModel *documentModel = Core::EditorManager::documentModel();
foreach (Core::IDocument *document, documentModel->openedDocuments()) {
QList<Core::IEditor *> editors = documentModel->editorsForDocument(document);
createPreviewForEditor(editors.takeFirst());
QmlLiveTextPreview *preview
= m_textPreviews.value(document->filePath());
foreach (Core::IEditor *editor, editors)
preview->associateEditor(editor);
}
}
}