summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin/editormanager
diff options
context:
space:
mode:
authormae <qtc-committer@nokia.com>2009-01-26 16:36:02 +0100
committermae <qtc-committer@nokia.com>2009-01-26 16:36:02 +0100
commitebcb9dce5af99e3148e5531f05d2fa31a0372217 (patch)
tree4b0ea7741e1ea51f960df5760f1cc21b5952ec64 /src/plugins/coreplugin/editormanager
parent1b345cfa0f96bf0b082c351bd91659a827705182 (diff)
downloadqt-creator-ebcb9dce5af99e3148e5531f05d2fa31a0372217.tar.gz
separate EM::setCurrentEditor and EM::activateEditor
Diffstat (limited to 'src/plugins/coreplugin/editormanager')
-rw-r--r--src/plugins/coreplugin/editormanager/editormanager.cpp6
-rw-r--r--src/plugins/coreplugin/editormanager/editormanager.h2
-rw-r--r--src/plugins/coreplugin/editormanager/openeditorswindow.cpp2
3 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index 7668bf8322..973d4153ee 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -687,7 +687,7 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
}
if (currentEditorRemoved) {
if (m_d->m_editorHistory.count() > 0) {
- setCurrentEditor(m_d->m_editorHistory.first(), true);
+ activateEditor(m_d->m_editorHistory.first(), true);
} else {
editorChanged(currentEditor());
}
@@ -1223,7 +1223,7 @@ void EditorManager::updateActions()
QList<IEditor*> EditorManager::openedEditors() const
{
- return m_d->m_view->editors();
+ return m_d->m_editorModel->editors();
}
Internal::EditorModel *EditorManager::openedEditorsModel() const
@@ -1611,7 +1611,7 @@ void EditorManager::unsplitAll()
{
m_d->m_splitter->unsplit(0);
if (IEditor *e = m_d->m_splitter->editor())
- setCurrentEditor(e);
+ activateEditor(e);
}
void EditorManager::gotoOtherWindow()
diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h
index 36448d44a3..833032be42 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.h
+++ b/src/plugins/coreplugin/editormanager/editormanager.h
@@ -116,7 +116,9 @@ public:
bool hasEditor(const QString &fileName) const;
QList<IEditor *> editorsForFileName(const QString &filename) const;
+private:
void setCurrentEditor(IEditor *editor, bool ignoreNavigationHistory = false);
+public:
IEditor *currentEditor() const;
IEditor *activateEditor(IEditor *editor, bool ignoreNavigationHistory = false);
// EditorGroup *currentEditorGroup() const;
diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp
index 316843c88e..f653e23511 100644
--- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp
+++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp
@@ -235,7 +235,7 @@ void OpenEditorsWindow::selectEditor(QTreeWidgetItem *item)
IEditor *editor = 0;
if (item)
editor = item->data(0, Qt::UserRole).value<IEditor*>();
- EditorManager::instance()->setCurrentEditor(editor);
+ EditorManager::instance()->activateEditor(editor);
}
void OpenEditorsWindow::editorClicked(QTreeWidgetItem *item)