+NickModel *Buffer::nickModel() const {
+ return _nickModel;
+}
+
+IrcChannel *Buffer::ircChannel() const {
+ return _ircChannel;
+}
+
+void Buffer::setIrcChannel(IrcChannel *ircchan) {
+ if(_ircChannel) {
+ disconnect(_ircChannel, 0, this, 0);
+ }
+ _ircChannel = ircchan;
+ if(_ircChannel) {
+ emit topicSet(_ircChannel->topic());
+ connect(_ircChannel, SIGNAL(topicSet(QString)), this, SIGNAL(topicSet(QString)));
+ connect(_ircChannel, SIGNAL(destroyed()), this, SLOT(setIrcChannel()));
+ }
+ _nickModel->setIrcChannel(ircChannel());
+}
+