X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircchannel.cpp;h=29b618f4e0b1a311ba20e8b0d743eec87bd41ff8;hp=b9caebd06be003d1030706fd726fd0b46543a189;hb=0ff076706c3d353ec9b098b1eca270195288774e;hpb=48979ba2c343ab50ae93a8bb1c355ce79115bd4f diff --git a/src/common/ircchannel.cpp b/src/common/ircchannel.cpp index b9caebd0..29b618f4 100644 --- a/src/common/ircchannel.cpp +++ b/src/common/ircchannel.cpp @@ -107,6 +107,7 @@ void IrcChannel::join(IrcUser *ircuser) { if(!_userModes.contains(ircuser) && ircuser) { _userModes[ircuser] = QString(); ircuser->joinChannel(name()); + connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed())); // no emit here since the join is propagated by IrcUser } } @@ -175,10 +176,10 @@ void IrcChannel::removeUserMode(const QString &nick, const QString &mode) { // INIT SET USER MODES QVariantMap IrcChannel::initUserModes() const { QVariantMap usermodes; - QHashIterator iter(_userModes); - while(iter.hasNext()) { - iter.next(); + QHash::const_iterator iter = _userModes.constBegin(); + while(iter != _userModes.constEnd()) { usermodes[iter.key()->nick()] = iter.value(); + iter++; } return usermodes; } @@ -194,7 +195,7 @@ void IrcChannel::initSetUserModes(const QVariantMap &usermodes) { void IrcChannel::ircUserDestroyed() { IrcUser *ircUser = static_cast(sender()); Q_ASSERT(ircUser); - part(ircUser); + _userModes.remove(ircUser); } void IrcChannel::setInitialized() {