X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.cpp;h=4c82418266dad2e2be95e423ee74b24e88510a0d;hp=227382b947a21b447e3c1efdfb62f555e9d24a1d;hb=6cd95dbc8ac28ab7a22e640d9fe6e3a6aff8f8a9;hpb=25bc72972586c19fb9a8c4a94d5845b2d16af121 diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 227382b9..4c824182 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -191,7 +191,6 @@ void BufferItem::part(IrcUser *ircUser) { void BufferItem::removeUserFromCategory(IrcUser *ircUser) { UserCategoryItem *categoryItem = 0; - IrcUserItem *userItem; for(int i = 0; i < childCount(); i++) { categoryItem = qobject_cast(child(i)); categoryItem->removeChildById((quint64)ircUser); @@ -202,10 +201,10 @@ void BufferItem::removeUserFromCategory(IrcUser *ircUser) { void BufferItem::userModeChanged(IrcUser *ircUser) { Q_ASSERT(_ircChannel); - + UserCategoryItem *categoryItem; int categoryId = UserCategoryItem::categoryFromModes(_ircChannel->userModes(ircUser)); - if((categoryItem = qobject_cast(childById(qHash(categoryId))))) + if((categoryItem = qobject_cast(childById(qHash(categoryId)))) && categoryItem->childById((quint64)(ircUser))) return; // already in the right category; removeUserFromCategory(ircUser);