From 043164b431a20fd832a70b06871d42fea2c439a5 Mon Sep 17 00:00:00 2001 From: Lasse Holmstedt <lasse.holmstedt@nokia.com> Date: Fri, 9 Apr 2010 10:03:04 +0200 Subject: [PATCH] Fix for closing splitters when editors are opened before split Now, ctrl+w closes all editors, as does "X" button in the toolbar. Reviewed-by: mae --- src/plugins/coreplugin/editormanager/editorview.cpp | 10 ++++++---- src/plugins/coreplugin/editortoolbar.cpp | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 48363270cce..d9d07a2b7ce 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -165,9 +165,9 @@ EditorView::~EditorView() void EditorView::closeView() { EditorManager *em = CoreImpl::instance()->editorManager(); - if (IEditor *editor = currentEditor()) { - em->closeDuplicate(editor); - } + IEditor *editor = currentEditor(); + if (editor) + em->closeEditor(editor); } void EditorView::showEditorInfoBar(const QString &id, const QString &infoText, @@ -705,7 +705,9 @@ void SplitterOrView::split(Qt::Orientation orientation) SplitterOrView *otherView = 0; if (e) { - m_view->removeEditor(e); + foreach(IEditor *editor, m_view->editors()) + m_view->removeEditor(editor); + m_splitter->addWidget((view = new SplitterOrView(e))); if (e->duplicateSupported()) { Core::IEditor *duplicate = em->duplicateEditor(e); diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 68b03c0a5d4..3223e828e70 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -177,7 +177,6 @@ void EditorToolBar::closeView() if (m_isStandalone) { EditorManager *em = ICore::instance()->editorManager(); if (IEditor *editor = currentEditor()) { - //em->closeDuplicate(editor); em->closeEditor(editor); } } -- GitLab