X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffer.cpp;h=b0e28621fa9d9d26cd8c0095d4ab7b8e85372e9f;hp=48d8a70795833ff47e2be404c99d654bd8459b47;hb=eaa92c3648f551569e504971ebc75021a7e3e720;hpb=6250a7e25eb2c0a6794d4aa5679c70082d825031 diff --git a/src/client/buffer.cpp b/src/client/buffer.cpp index 48d8a707..b0e28621 100644 --- a/src/client/buffer.cpp +++ b/src/client/buffer.cpp @@ -22,13 +22,16 @@ #include "buffer.h" #include "client.h" +#include "ircchannel.h" +#include "nickmodel.h" #include "util.h" Buffer::Buffer(BufferInfo bufferid, QObject *parent) : QObject(parent), _bufferInfo(bufferid), - _active(false) + _active(false), + _ircChannel(0), _nickModel(0) { if(bufferid.buffer().isEmpty()) _type = StatusType; @@ -37,6 +40,7 @@ Buffer::Buffer(BufferInfo bufferid, QObject *parent) else _type = QueryType; + _nickModel = new NickModel(0, this); /* QSettings s; s.beginGroup(QString("GUI/BufferStates/%1/%2").arg(netname).arg(bufname)); @@ -147,6 +151,25 @@ void Buffer::processUserInput(QString msg) { emit userInput(_bufferInfo, msg); } +NickModel *Buffer::nickModel() const { + return _nickModel; +} + +IrcChannel *Buffer::ircChannel() const { + return _ircChannel; +} + +void Buffer::setIrcChannel(IrcChannel *ircchan) { return; + if(_ircChannel) { + disconnect(_ircChannel, 0, this, 0); + } + _ircChannel = ircchan; + if(_ircChannel) { + connect(_ircChannel, SIGNAL(destroyed()), this, SLOT(setIrcChannel())); + } + _nickModel->setIrcChannel(ircChannel()); +} + // no longer needed // back reference: // void Buffer::setTopic(QString t) {