X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=2ff57017dd057e9e3ba8ceebb5ed3a222423bfdf;hb=cb7da7f32d352d7fc7b680be442a9dc7451b4ffa;hp=1191d88f934f62e4a685d4259bcc7a5478ed9575;hpb=6b2f3b5846f1329e9a5ea38192ae9ca6e47920bd;p=quassel.git diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 1191d88f..2ff57017 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -469,6 +469,7 @@ void MainWin::removeBufferView(int bufferViewConfigId) { if(dock && actionData.toInt() == bufferViewConfigId) { removeAction(action); _bufferViews.removeAll(dock); + Client::bufferViewOverlay()->removeView(dock->bufferViewId()); dock->deleteLater(); } } @@ -479,6 +480,11 @@ void MainWin::bufferViewToggled(bool enabled) { Q_ASSERT(action); BufferViewDock *dock = qobject_cast(action->parent()); Q_ASSERT(dock); + + // Make sure we don't toggle backlog fetch for a view we've already removed + if(!_bufferViews.contains(dock)) + return; + if(enabled) { Client::bufferViewOverlay()->addView(dock->bufferViewId()); BufferViewConfig *config = dock->config(); @@ -741,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; } @@ -776,6 +790,7 @@ void MainWin::disconnectedFromCore() { if(dock && actionData.toInt() != -1) { removeAction(action); _bufferViews.removeAll(dock); + Client::bufferViewOverlay()->removeView(dock->bufferViewId()); dock->deleteLater(); } }