- AbstractChatView *chatView = 0;
- Buffer *buf = Client::buffer(bufferId);
- if(!buf) {
- qWarning() << "AbstractBufferContainer::setBuffer(BufferId): Can't show unknown Buffer:" << bufferId;
- return;
- }
- Buffer *prevBuffer = Client::buffer(currentBuffer());
- if(prevBuffer) prevBuffer->setVisible(false);
- if(_chatViews.contains(bufferId)) {
- chatView = _chatViews[bufferId];
- } else {
- chatView = createChatView(bufferId);
- chatView->setContents(buf->contents());
- connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), this, SLOT(appendMsg(AbstractUiMsg *)));
- connect(buf, SIGNAL(msgPrepended(AbstractUiMsg *)), this, SLOT(prependMsg(AbstractUiMsg *)));
- _chatViews[bufferId] = chatView;
- }