Fix the fallback code used when restoring session fails

Authored by jpalecek on Sep 1 2019, 10:31 PM.

Description

Fix the fallback code used when restoring session fails

Summary:
When restoring session in Konsole fails, the fallback code should
create a default view and session instead. However, the code omitted
adding this view to the container, which makes

  • the window black (or grey in my case), see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=935031
  • konsole crash later, when you add a new tab and close it, because code in ViewManager expects TerminalDisplays to be children of ViewSplitter, which is not the case

    This fix adds the view to activeController(), just like every other code that creates TerminalDisplay.

Test Plan:

  1. find a session in your $HOME/.config/session/ from konsole before 19.08
  2. konsole -session xxxx (where xxxx are the numbers in the session file) -> there should be a konsole window with usable terminal
  3. add a new tab with C-S-T and close it ->there should be no crash

Reviewers: hindenburg, Konsole

Reviewed By: hindenburg, Konsole

Subscribers: tcanabrava, konsole-devel

Tags: Konsole

Differential Revision: https://phabricator.kde.org/D23601