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();
}
int categoryId = UserCategoryItem::categoryFromModes(_ircChannel->userModes(ircUser));
UserCategoryItem *categoryItem = qobject_cast<UserCategoryItem *>(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;
Q_UNUSED(column);
QStringList toolTip(QString("<b>%1</b>").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());