X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffer.cpp;h=b533dd6c14e89a1468845e38b0d852e7196238f3;hp=b0e28621fa9d9d26cd8c0095d4ab7b8e85372e9f;hb=d47cd9b56ba10dc6e20baeabbd2b51305824b8c2;hpb=eaa92c3648f551569e504971ebc75021a7e3e720 diff --git a/src/client/buffer.cpp b/src/client/buffer.cpp index b0e28621..b533dd6c 100644 --- a/src/client/buffer.cpp +++ b/src/client/buffer.cpp @@ -107,12 +107,12 @@ QVariantMap Buffer::nickList() const { } QString Buffer::topic() const { - // FIXME check if we got a networkInfo() object + if(ircChannel()) return ircChannel()->topic(); return QString(); } QString Buffer::ownNick() const { - // FIXME check if we got a networkInfo() object + // FIXME if(ircChannel()) return ircChannel()->ownNick(); return QString(); } @@ -159,12 +159,14 @@ IrcChannel *Buffer::ircChannel() const { return _ircChannel; } -void Buffer::setIrcChannel(IrcChannel *ircchan) { return; +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()); @@ -172,11 +174,6 @@ void Buffer::setIrcChannel(IrcChannel *ircchan) { return; // no longer needed // back reference: -// void Buffer::setTopic(QString t) { -// _topic = t; -// emit topicSet(t); -// emit bufferUpdated(this); -// } // void Buffer::addNick(QString nick, QVariantMap props) { // if(nick == ownNick()) setActive(true);