From 7f88be2edd15277c9121c9bb5fd4d1e89ecfcd6d Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 18 Nov 2009 23:52:23 +0100 Subject: [PATCH] Show default bufferview if we don't have a saved state --- src/qtui/mainwin.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 9030bfdd..2ff57017 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -747,7 +747,15 @@ void MainWin::setConnectedState() { void MainWin::loadLayout() { QtUiSettings s; int accountId = Client::currentCoreAccount().toInt(); - restoreState(s.value(QString("MainWinState-%1").arg(accountId)).toByteArray(), accountId); + QByteArray state = s.value(QString("MainWinState-%1").arg(accountId)).toByteArray(); + if(state.isEmpty()) { + // Make sure that the default bufferview is shown + if(_bufferViews.count()) + _bufferViews.at(0)->show(); + return; + } + + restoreState(state, accountId); _layoutLoaded = true; } -- 2.20.1