_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;
}
_userModes[ircuser] = sortedModes[i];
ircuser->joinChannel(this, true);
- connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString)));
+ connect(ircuser, &IrcUser::nickSet, this, selectOverload<QString>(&IrcChannel::ircUserNickSet));
// connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
// If you wonder why there is no counterpart to ircUserJoined:
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()) {
QList<IrcUser *> users = _userModes.keys();
_userModes.clear();
foreach(IrcUser *user, users) {
- disconnect(user, 0, this, 0);
+ disconnect(user, nullptr, this, nullptr);
user->partChannel(this);
}
emit parted();
void IrcChannel::ircUserDestroyed()
{
- IrcUser *ircUser = static_cast<IrcUser *>(sender());
+ auto *ircUser = static_cast<IrcUser *>(sender());
Q_ASSERT(ircUser);
_userModes.remove(ircUser);
// no further propagation.
void IrcChannel::ircUserNickSet(QString nick)
{
- IrcUser *ircUser = qobject_cast<IrcUser *>(sender());
+ auto *ircUser = qobject_cast<IrcUser *>(sender());
Q_ASSERT(ircUser);
emit ircUserNickSet(ircUser, nick);
}