X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircchannel.cpp;h=dd47f8512d48d264919313aa84f9011ddfb3dd58;hp=43e1dee110071fc86caca5564c8dd965c4a51f9f;hb=39328183a6a87c6eb10a9dbbffcd5d65bf154a1f;hpb=1a3cdccd4c4465bdb684a4e0927c8431e306c7cc diff --git a/src/common/ircchannel.cpp b/src/common/ircchannel.cpp index 43e1dee1..dd47f851 100644 --- a/src/common/ircchannel.cpp +++ b/src/common/ircchannel.cpp @@ -30,7 +30,6 @@ #include -INIT_SYNCABLE_OBJECT(IrcChannel) IrcChannel::IrcChannel(const QString &channelname, Network *network) : SyncableObject(network), _initialized(false), @@ -38,8 +37,8 @@ IrcChannel::IrcChannel(const QString &channelname, Network *network) _topic(QString()), _encrypted(false), _network(network), - _codecForEncoding(0), - _codecForDecoding(0) + _codecForEncoding(nullptr), + _codecForDecoding(nullptr) { setObjectName(QString::number(network->networkId().toInt()) + "/" + channelname); } @@ -55,13 +54,13 @@ IrcChannel::~IrcChannel() // ==================== bool IrcChannel::isKnownUser(IrcUser *ircuser) const { - if (ircuser == 0) { + if (ircuser == nullptr) { qWarning() << "Channel" << name() << "received IrcUser Nullpointer!"; return false; } if (!_userModes.contains(ircuser)) { - qWarning() << "Channel" << name() << "received data for unknown User" << ircuser->nick(); + // This can happen e.g. when disconnecting from a network, so don't log a warning return false; } @@ -180,7 +179,9 @@ void IrcChannel::joinIrcUsers(const QList &users, const QStringList & IrcUser *ircuser; for (int i = 0; i < users.count(); i++) { ircuser = users[i]; - if (!ircuser || _userModes.contains(ircuser)) { + if (!ircuser) + continue; + if (_userModes.contains(ircuser)) { if (sortedModes[i].count() > 1) { // Multiple modes received, do it one at a time // TODO Better way of syncing this without breaking protocol? @@ -240,7 +241,7 @@ void IrcChannel::part(IrcUser *ircuser) ircuser->partChannel(this); // If you wonder why there is no counterpart to ircUserParted: // the joins are propagted by the ircuser. The signal ircUserParted is only for convenience - disconnect(ircuser, 0, this, 0); + disconnect(ircuser, nullptr, this, nullptr); emit ircUserParted(ircuser); if (network()->isMe(ircuser) || _userModes.isEmpty()) { @@ -249,7 +250,7 @@ void IrcChannel::part(IrcUser *ircuser) QList users = _userModes.keys(); _userModes.clear(); foreach(IrcUser *user, users) { - disconnect(user, 0, this, 0); + disconnect(user, nullptr, this, nullptr); user->partChannel(this); } emit parted();