From b2cf1b73760eadbeb3452d8d2260e1dc876e6fe5 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Sat, 26 Jan 2008 14:25:34 +0000 Subject: [PATCH 1/1] Fixed inconsitency bug in the NetworkModel. (thanks int for the trace). ... and yes I really do think that I'm the only one who's updating the version numbers... --- src/client/networkmodel.cpp | 23 +++++++++++------------ src/client/networkmodel.h | 2 -- version.inc | 2 +- 3 files changed, 12 insertions(+), 15 deletions(-) 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 diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index 29468727..d891dd0e 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -182,11 +182,9 @@ public: virtual quint64 id() const; virtual QVariant data(int column, int role) const; - private slots: void setNick(QString newNick); - void ircUserDestroyed(); private: IrcUser *_ircUser; diff --git a/version.inc b/version.inc index d671717a..4ea610d9 100644 --- a/version.inc +++ b/version.inc @@ -5,7 +5,7 @@ quasselVersion = "0.2.0-pre"; quasselDate = "2008-01-23"; - quasselBuild = 379; + quasselBuild = 388; //! Minimum client build number the core needs clientBuildNeeded = 358; -- 2.20.1