diff options
author | Eike Ziller <eike.ziller@qt.io> | 2021-03-11 16:09:18 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2021-03-15 07:57:08 +0000 |
commit | 280545fdf89fe92b6f2b6b28e2c4d86c862c3d71 (patch) | |
tree | e99ed9d0ce925bb1b53b49cd02b390c36a43b784 | |
parent | e2112d68310965488e5640f810669580eb9ee57f (diff) |
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 ee1e6ca50821ace4323a0838452dda59b1a352a2
Fixes: QTCREATORBUG-24869
Change-Id: I9e1982697700079e037695e100ef71eadaf7849f
Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r-- | src/plugins/coreplugin/editormanager/editormanager.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 36c1ae3634..f45b49ae1b 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1743,10 +1743,12 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla foreach (IEditor *editor, acceptedEditors) delete editor; - if (focusView) + if (focusView) { activateView(focusView); - else + } else { + setCurrentView(currentView); setCurrentEditor(currentView->currentEditor()); + } if (!EditorManager::currentEditor()) { emit m_instance->currentEditorChanged(nullptr); |