X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircuser.cpp;h=affd64b749ad47f4a32ee2e969be227e4ccc06c5;hp=91b3a2b2ea7d16ff8f341bc5699619188cff6691;hb=dcc90a564e00e206f05db224f1654c8907f149f4;hpb=da2eb70e632526088ef0e31cfd52beb563ce31ce diff --git a/src/common/ircuser.cpp b/src/common/ircuser.cpp index 91b3a2b2..affd64b7 100644 --- a/src/common/ircuser.cpp +++ b/src/common/ircuser.cpp @@ -136,7 +136,6 @@ void IrcUser::setHost(const QString &host) { void IrcUser::setNick(const QString &nick) { if(!nick.isEmpty() && nick != _nick) { - QString oldnick(_nick); _nick = nick; updateObjectName(); emit nickSet(nick); @@ -144,14 +143,14 @@ void IrcUser::setNick(const QString &nick) { } void IrcUser::updateObjectName() { - QString oldName(objectName()); - setObjectName(QString::number(networkInfo->networkId()) + "/" + _nick); - if(!oldName.isEmpty()) { - emit renameObject(oldName, objectName()); + QString newName = QString::number(networkInfo->networkId()) + "/" + _nick; + QString oldName = objectName(); + if(oldName != newName) { + setObjectName(newName); + emit renameObject(oldName, newName); } } - void IrcUser::updateHostmask(const QString &mask) { if(mask == hostmask()) return; @@ -165,9 +164,9 @@ void IrcUser::updateHostmask(const QString &mask) { void IrcUser::joinChannel(IrcChannel *channel) { Q_ASSERT(channel); if(!_channels.contains(channel)) { + _channels.insert(channel); channel->join(this); connect(channel, SIGNAL(destroyed()), this, SLOT(channelDestroyed())); - _channels.insert(channel); emit channelJoined(channel->name()); } }