forked from qt-creator/qt-creator
Editors: Fix soft assert about empty currentView
We need to always either have a current view or a current editor.
Make sure we set the current view if we end up without a current
editor when closing files.
Amends ee1e6ca508
Fixes: QTCREATORBUG-24869
Change-Id: I9e1982697700079e037695e100ef71eadaf7849f
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -1743,10 +1743,12 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
|
|||||||
foreach (IEditor *editor, acceptedEditors)
|
foreach (IEditor *editor, acceptedEditors)
|
||||||
delete editor;
|
delete editor;
|
||||||
|
|
||||||
if (focusView)
|
if (focusView) {
|
||||||
activateView(focusView);
|
activateView(focusView);
|
||||||
else
|
} else {
|
||||||
|
setCurrentView(currentView);
|
||||||
setCurrentEditor(currentView->currentEditor());
|
setCurrentEditor(currentView->currentEditor());
|
||||||
|
}
|
||||||
|
|
||||||
if (!EditorManager::currentEditor()) {
|
if (!EditorManager::currentEditor()) {
|
||||||
emit m_instance->currentEditorChanged(nullptr);
|
emit m_instance->currentEditorChanged(nullptr);
|
||||||
|
Reference in New Issue
Block a user