X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircchannel.cpp;h=37318d9e14088682dbf511f6d82e06797fd0079a;hp=0684c665a8ebf93eaac35bb46129af52c7f4c955;hb=6eefdfc697067d184a589fc8a231b16316c09106;hpb=29252b7065315dfb5b4a226f7ab7998bfd08ee65 diff --git a/src/common/ircchannel.cpp b/src/common/ircchannel.cpp index 0684c665..37318d9e 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,30 +37,25 @@ 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); } -IrcChannel::~IrcChannel() -{ -} - - // ==================== // PUBLIC: // ==================== 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; } @@ -197,7 +191,7 @@ void IrcChannel::joinIrcUsers(const QList &users, const QStringList & _userModes[ircuser] = sortedModes[i]; ircuser->joinChannel(this, true); - connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString))); + connect(ircuser, &IrcUser::nickSet, this, selectOverload(&IrcChannel::ircUserNickSet)); // connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed())); // If you wonder why there is no counterpart to ircUserJoined: @@ -242,7 +236,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()) { @@ -251,7 +245,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(); @@ -430,7 +424,7 @@ void IrcChannel::initSetChanModes(const QVariantMap &channelModes) void IrcChannel::ircUserDestroyed() { - IrcUser *ircUser = static_cast(sender()); + auto *ircUser = static_cast(sender()); Q_ASSERT(ircUser); _userModes.remove(ircUser); // no further propagation. @@ -440,7 +434,7 @@ void IrcChannel::ircUserDestroyed() void IrcChannel::ircUserNickSet(QString nick) { - IrcUser *ircUser = qobject_cast(sender()); + auto *ircUser = qobject_cast(sender()); Q_ASSERT(ircUser); emit ircUserNickSet(ircUser, nick); }