- int accountId = Client::currentCoreAccount().toInt();
- restoreState(s.value(QString("MainWinState-%1").arg(accountId)).toByteArray(), accountId);
+ int accountId = Client::currentCoreAccount().accountId().toInt();
+ 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;