X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.h;h=4dcb65cc518c4fab70fc118e59b6f3a9ca4f3a9f;hp=8ccd604e3ba16a828c9df11881d7de89aa635f21;hb=fe9ec46e2b6394b7735a73da5c438b10ba7e5e82;hpb=3e4bd5ae86319de1a63622144bb0bbbf977b8478 diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index 8ccd604e..4dcb65cc 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -53,7 +53,6 @@ class NetworkItem : public PropertyMapItem { public: NetworkItem(const NetworkId &netid, AbstractTreeItem *parent = 0); - virtual quint64 id() const { return qHash(_networkId); } virtual QVariant data(int column, int row) const; inline bool isActive() const { return (bool)_network ? _network->isConnected() : false; } @@ -65,6 +64,8 @@ public: virtual QString toolTip(int column) const; + BufferItem *findBufferItem(BufferId bufferId); + inline BufferItem *findBufferItem(const BufferInfo &bufferInfo) { return findBufferItem(bufferInfo.bufferId()); } BufferItem *bufferItem(const BufferInfo &bufferInfo); public slots: @@ -94,7 +95,6 @@ public: BufferItem(const BufferInfo &bufferInfo, AbstractTreeItem *parent = 0); inline const BufferInfo &bufferInfo() const { return _bufferInfo; } - virtual inline quint64 id() const { return qHash(_bufferInfo.bufferId()); } virtual QVariant data(int column, int role) const; virtual bool setData(int column, const QVariant &value, int role); @@ -162,6 +162,8 @@ private: /***************************************** * ChannelBufferItem *****************************************/ +class UserCategoryItem; + class ChannelBufferItem : public BufferItem { Q_OBJECT @@ -180,6 +182,7 @@ public slots: void join(const QList &ircUsers); void part(IrcUser *ircUser); + UserCategoryItem *findCategoryItem(int categoryId); void addUserToCategory(IrcUser *ircUser); void addUsersToCategory(const QList &ircUser); void removeUserFromCategory(IrcUser *ircUser); @@ -196,6 +199,7 @@ private: /***************************************** * User Category Items (like @vh etc.) *****************************************/ +class IrcUserItem; class UserCategoryItem : public PropertyMapItem { Q_OBJECT Q_PROPERTY(QString categoryName READ categoryName) @@ -204,9 +208,10 @@ public: UserCategoryItem(int category, AbstractTreeItem *parent); QString categoryName() const; - virtual quint64 id() const; + inline int categoryId() const { return _category; } virtual QVariant data(int column, int role) const; - + + IrcUserItem *findIrcUser(IrcUser *ircUser); void addUsers(const QList &ircUser); bool removeUser(IrcUser *ircUser); @@ -232,13 +237,11 @@ public: bool isActive() const; inline IrcUser *ircUser() { return _ircUser; } - inline virtual quint64 id() const { return _id; } virtual QVariant data(int column, int role) const; virtual QString toolTip(int column) const; private: QPointer _ircUser; - quint64 _id; }; @@ -295,10 +298,12 @@ public slots: void networkRemoved(const NetworkId &networkId); private: + int networkRow(NetworkId networkId); + NetworkItem *findNetworkItem(NetworkId networkId); NetworkItem *networkItem(NetworkId networkId); - NetworkItem *existsNetworkItem(NetworkId networkId); + BufferItem *findBufferItem(const BufferInfo &bufferInfo); + BufferItem *findBufferItem(BufferId bufferId); BufferItem *bufferItem(const BufferInfo &bufferInfo); - BufferItem *existsBufferItem(const BufferInfo &bufferInfo); }; Q_DECLARE_OPERATORS_FOR_FLAGS(NetworkModel::itemTypes);