X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircchannel.cpp;h=f5710ba2f2871ac2e69e3337a0e555eb01de7938;hp=5c12171a5372c32e11f9384fa9cefdc4cd927d86;hb=723db5bff304ad3fdf5a0609198c65a66bfbaea7;hpb=d1b6499b0b848d4287efae89107576548533502c diff --git a/src/common/ircchannel.cpp b/src/common/ircchannel.cpp index 5c12171a..f5710ba2 100644 --- a/src/common/ircchannel.cpp +++ b/src/common/ircchannel.cpp @@ -33,18 +33,18 @@ #include -IrcChannel::IrcChannel(const QString &channelname, Network *network) - : SyncableObject(network), +IrcChannel::IrcChannel(const QString &channelname, Network *network) : SyncableObject(network), _initialized(false), _name(channelname), _topic(QString()), - network(network) + network(network), + _codecForEncoding(0), + _codecForDecoding(0) { - setObjectName(QString::number(network->networkId()) + "/" + channelname); + setObjectName(QString::number(network->networkId().toInt()) + "/" + channelname); } IrcChannel::~IrcChannel() { - } // ==================== @@ -125,7 +125,7 @@ QString IrcChannel::decodeString(const QByteArray &text) const { return ::decodeString(text, _codecForDecoding); } -QByteArray IrcChannel::encodeString(const QString string) const { +QByteArray IrcChannel::encodeString(const QString &string) const { if(codecForEncoding()) { return _codecForEncoding->fromUnicode(string); } @@ -143,7 +143,7 @@ void IrcChannel::setTopic(const QString &topic) { void IrcChannel::join(IrcUser *ircuser) { if(!_userModes.contains(ircuser) && ircuser) { _userModes[ircuser] = QString(); - ircuser->joinChannel(name()); + ircuser->joinChannel(this); //qDebug() << "JOIN" << name() << ircuser->nick() << ircUsers().count(); connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString))); connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed())); @@ -160,10 +160,11 @@ void IrcChannel::join(const QString &nick) { void IrcChannel::part(IrcUser *ircuser) { if(isKnownUser(ircuser)) { _userModes.remove(ircuser); - ircuser->partChannel(name()); + ircuser->partChannel(this); //qDebug() << "PART" << name() << ircuser->nick() << ircUsers().count(); // if you wonder why there is no counterpart to ircUserParted: // the joines are propagted by the ircuser. the signal ircUserParted is only for convenience + disconnect(ircuser, 0, this, 0); emit ircUserParted(ircuser); if(network->isMe(ircuser)) deleteLater(); @@ -244,8 +245,8 @@ void IrcChannel::ircUserDestroyed() { IrcUser *ircUser = static_cast(sender()); Q_ASSERT(ircUser); _userModes.remove(ircUser); - emit ircUserParted(ircUser); - //qDebug() << "DEST" << name() << ircUsers().count(); + // no further propagation. + // this leads only to fuck ups. } void IrcChannel::ircUserNickSet(QString nick) {