Commit a731cd88 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Only emit empty() in SessionFinished() when in TabbedNavigation mode

empty() is emitted so that MainWindow calls close() and we get rid of the
colours-flashing bug when closing the last session/tab in a window, see
commit bbec7225. However all that isn't relevant when we are in
konsole Part mode, where there are no tabs or MainWindows.

This fixes a crash in Dolphin when closing its window while the embedded
Konsole Part is open. The crash would happen as calling
ViewContainer::currentTabViewCount() would end up in the ViewSplitter code
path, which is no-op in Konsole Part.

To test:
- Open dolphin, make sure the terminal panel isn't open to begin with
- open the terminal panel
- close the dolphin window while the terminal panel is open

BUG: 441206
FIXED-IN: 21.08.1
(cherry picked from commit 2684bc7f)
parent bd1ca428
......@@ -494,11 +494,13 @@ void ViewManager::sessionFinished()
return;
}
// The last session/tab, and only one view (no splits), emit empty()
// so that close() is called in MainWindow, fixes #432077
if (_viewContainer->count() == 1 && _viewContainer->currentTabViewCount() == 1) {
Q_EMIT empty();
return;
if (_navigationMethod == TabbedNavigation) {
// The last session/tab, and only one view (no splits), emit empty()
// so that close() is called in MainWindow, fixes #432077
if (_viewContainer->count() == 1 && _viewContainer->currentTabViewCount() == 1) {
Q_EMIT empty();
return;
}
}
auto *session = qobject_cast<Session *>(sender());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment