forked from qt-creator/qt-creator
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
This commit is contained in:
@@ -165,9 +165,9 @@ EditorView::~EditorView()
|
|||||||
void EditorView::closeView()
|
void EditorView::closeView()
|
||||||
{
|
{
|
||||||
EditorManager *em = CoreImpl::instance()->editorManager();
|
EditorManager *em = CoreImpl::instance()->editorManager();
|
||||||
if (IEditor *editor = currentEditor()) {
|
IEditor *editor = currentEditor();
|
||||||
em->closeDuplicate(editor);
|
if (editor)
|
||||||
}
|
em->closeEditor(editor);
|
||||||
}
|
}
|
||||||
void EditorView::showEditorInfoBar(const QString &id,
|
void EditorView::showEditorInfoBar(const QString &id,
|
||||||
const QString &infoText,
|
const QString &infoText,
|
||||||
@@ -705,7 +705,9 @@ void SplitterOrView::split(Qt::Orientation orientation)
|
|||||||
SplitterOrView *otherView = 0;
|
SplitterOrView *otherView = 0;
|
||||||
if (e) {
|
if (e) {
|
||||||
|
|
||||||
m_view->removeEditor(e);
|
foreach(IEditor *editor, m_view->editors())
|
||||||
|
m_view->removeEditor(editor);
|
||||||
|
|
||||||
m_splitter->addWidget((view = new SplitterOrView(e)));
|
m_splitter->addWidget((view = new SplitterOrView(e)));
|
||||||
if (e->duplicateSupported()) {
|
if (e->duplicateSupported()) {
|
||||||
Core::IEditor *duplicate = em->duplicateEditor(e);
|
Core::IEditor *duplicate = em->duplicateEditor(e);
|
||||||
|
|||||||
@@ -177,7 +177,6 @@ void EditorToolBar::closeView()
|
|||||||
if (m_isStandalone) {
|
if (m_isStandalone) {
|
||||||
EditorManager *em = ICore::instance()->editorManager();
|
EditorManager *em = ICore::instance()->editorManager();
|
||||||
if (IEditor *editor = currentEditor()) {
|
if (IEditor *editor = currentEditor()) {
|
||||||
//em->closeDuplicate(editor);
|
|
||||||
em->closeEditor(editor);
|
em->closeEditor(editor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user