X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.cpp;h=8b9dfad846061233aca85dda38024d58eedafbb4;hp=784f3fc816bbfb2a0c7247bedfd7693280d98817;hb=b2cf1b73760eadbeb3452d8d2260e1dc876e6fe5;hpb=17fa75dd07c1da977c11900fcbed89f77a962857 diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 784f3fc8..8b9dfad8 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -190,6 +190,8 @@ void BufferItem::part(IrcUser *ircUser) { } void BufferItem::removeUserFromCategory(IrcUser *ircUser) { + Q_ASSERT(_ircChannel); + UserCategoryItem *categoryItem = 0; for(int i = 0; i < childCount(); i++) { categoryItem = qobject_cast(child(i)); @@ -312,12 +314,13 @@ void NetworkItem::setCurrentServer(const QString &serverName) { *****************************************/ // we hardcode this even though we have PREFIX in network... but that wouldn't help with mapping modes to // category strings anyway. -const QList UserCategoryItem::categories = QList() << UserCategoryItem::Category('q', "Owners") - << UserCategoryItem::Category('a', "Admins") - << UserCategoryItem::Category('a', "Admins") - << UserCategoryItem::Category('o', "Operators") - << UserCategoryItem::Category('h', "Half-Ops") - << UserCategoryItem::Category('v', "Voiced"); +const QList UserCategoryItem::categories = QList() + << UserCategoryItem::Category('q', "Owners") + << UserCategoryItem::Category('a', "Admins") + << UserCategoryItem::Category('a', "Admins") + << UserCategoryItem::Category('o', "Operators") + << UserCategoryItem::Category('h', "Half-Ops") + << UserCategoryItem::Category('v', "Voiced"); UserCategoryItem::UserCategoryItem(int category, AbstractTreeItem *parent) : PropertyMapItem(QStringList() << "categoryId", parent), @@ -355,8 +358,8 @@ IrcUserItem::IrcUserItem(IrcUser *ircUser, AbstractTreeItem *parent) : PropertyMapItem(QStringList() << "nickName", parent), _ircUser(ircUser) { - connect(ircUser, SIGNAL(destroyed()), - this, SLOT(ircUserDestroyed())); + // we don't need to handle the ircUser's destroyed signal since it's automatically removed + // by the IrcChannel::ircUserParted(); connect(ircUser, SIGNAL(nickSet(QString)), this, SLOT(setNick(QString))); @@ -385,10 +388,6 @@ void IrcUserItem::setNick(QString newNick) { Q_UNUSED(newNick); emit dataChanged(0); } -void IrcUserItem::ircUserDestroyed() { - parent()->removeChildById(id()); - // deleteLater(); -} /***************************************** * NetworkModel