X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.cpp;h=6b155a04f21becf48f92c471d025e1fb68c33a5e;hb=52df0969e22249e6758714eec9e5afd7d4fe9b83;hp=1a692ca50c17162d2c57da29de3e61b6b655ee9c;hpb=5a9559260e3b80c8578fc1102a40454c92807463;p=quassel.git diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 1a692ca5..6b155a04 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -325,10 +325,8 @@ void ChannelBufferItem::attachIrcChannel(IrcChannel *ircChannel) { connect(ircChannel, SIGNAL(ircUserModeRemoved(IrcUser *, QString)), this, SLOT(userModeChanged(IrcUser *))); - if(!ircChannel->ircUsers().isEmpty()) { - qWarning() << "Channel" << ircChannel->name() << "has already users which is quite surprising :)"; + if(!ircChannel->ircUsers().isEmpty()) join(ircChannel->ircUsers()); - } emit dataChanged(); } @@ -426,8 +424,13 @@ void ChannelBufferItem::userModeChanged(IrcUser *ircUser) { int categoryId = UserCategoryItem::categoryFromModes(_ircChannel->userModes(ircUser)); UserCategoryItem *categoryItem = qobject_cast(childById(qHash(categoryId))); - if(categoryItem && categoryItem->childById(qHash(ircUser))) - return; // already in the right category; + if(categoryItem) { + if(categoryItem->childById(qHash(ircUser))) + return; // already in the right category; + } else { + categoryItem = new UserCategoryItem(categoryId, this); + newChild(categoryItem); + } // find the item that needs reparenting IrcUserItem *ircUserItem = 0; @@ -572,8 +575,11 @@ QString IrcUserItem::toolTip(int column) const { Q_UNUSED(column); QStringList toolTip(QString("%1").arg(nickName())); if(_ircUser->userModes() != "") toolTip[0].append(QString(" (%1)").arg(_ircUser->userModes())); - if(_ircUser->isAway()) toolTip[0].append(" is away"); - if(!_ircUser->awayMessage().isEmpty()) toolTip[0].append(QString(" (%1)").arg(_ircUser->awayMessage())); + if(_ircUser->isAway()) { + toolTip[0].append(" is away"); + if(!_ircUser->awayMessage().isEmpty()) + toolTip[0].append(QString(" (%1)").arg(_ircUser->awayMessage())); + } if(!_ircUser->realName().isEmpty()) toolTip.append(_ircUser->realName()); if(!_ircUser->ircOperator().isEmpty()) toolTip.append(QString("%1 %2").arg(nickName()).arg(_ircUser->ircOperator())); if(!_ircUser->suserHost().isEmpty()) toolTip.append(_ircUser->suserHost());