Commit e49a8d9a authored by con's avatar con
Browse files

Add method to get all the visible "top level" editors in splits.

parent 0d02c49c
......@@ -1616,6 +1616,27 @@ bool EditorManager::hasSplitter() const
return m_d->m_splitter->isSplitter();
}
QList<IEditor*> EditorManager::visibleEditors() const
{
QList<IEditor *> editors;
if (m_d->m_splitter->isSplitter()) {
SplitterOrView *firstView = m_d->m_splitter->findFirstView();
SplitterOrView *view = firstView;
if (view) {
do {
if (view->editor())
editors.append(view->editor());
view = m_d->m_splitter->findNextView(view);
} while (view && view != firstView);
}
} else {
if (m_d->m_splitter->editor()) {
editors.append(m_d->m_splitter->editor());
}
}
return editors;
}
QList<IEditor*> EditorManager::openedEditors() const
{
return m_d->m_editorModel->editors();
......
......@@ -133,18 +133,18 @@ public:
QList<IEditor *> editorsForFile(IFile *file) const;
IEditor *currentEditor() const;
QList<IEditor *> visibleEditors() const;
QList<IEditor*> openedEditors() const;
IEditor *activateEditor(IEditor *editor, OpenEditorFlags flags = 0);
IEditor *activateEditor(const QModelIndex &index, Internal::EditorView *view = 0, OpenEditorFlags = 0);
IEditor *activateEditor(Core::Internal::EditorView *view, Core::IFile*file, OpenEditorFlags flags = 0);
QList<IEditor*> openedEditors() const;
OpenEditorsModel *openedEditorsModel() const;
void closeEditor(const QModelIndex &index);
void closeOtherEditors(IEditor *editor);
QList<IEditor*> editorsForFiles(QList<IFile*> files) const;
//QList<EditorGroup *> editorGroups() const;
void addCurrentPositionToNavigationHistory(IEditor *editor = 0, const QByteArray &saveState = QByteArray());
void cutForwardNavigationHistory();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment