X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.h;h=8dceb5a485b0cbb5b1681e99bb327dfc2efc1e20;hp=dc010dd8a0ee8f7733d50778bbca6d3c0c0c11f3;hb=52a7b4d0f289f075aa386445a47d876743bcb6d0;hpb=9850247cc7533d35d71d202e32d9734197bb6f08 diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index dc010dd8..8dceb5a4 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -33,12 +33,12 @@ class BufferInfo; #include "selectionmodelsynchronizer.h" #include "modelpropertymapper.h" #include "clientsettings.h" +#include "ircuser.h" class MappedSelectionModel; class QAbstractItemView; class Network; class IrcChannel; -class IrcUser; /***************************************** * Fancy Buffer Items @@ -72,7 +72,7 @@ public: bool isActive() const; inline Buffer::ActivityLevel activityLevel() const { return _activity; } - bool setActivityLevel(Buffer::ActivityLevel level); + void setActivityLevel(Buffer::ActivityLevel level); void updateActivityLevel(Buffer::ActivityLevel level); void setLastMsgInsert(QDateTime msgDate); @@ -100,7 +100,7 @@ private: QString _bufferName; Buffer::ActivityLevel _activity; - QPointer _ircChannel; + IrcChannel *_ircChannel; }; @@ -179,8 +179,8 @@ public: QString nickName() const; bool isActive() const; - IrcUser *ircUser(); - virtual quint64 id() 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; @@ -211,12 +211,13 @@ public: ItemTypeRole }; - enum itemTypes { - NetworkItemType, - BufferItemType, - UserCategoryItemType, - IrcUserItemType + enum itemType { + NetworkItemType = 0x01, + BufferItemType = 0x02, + UserCategoryItemType = 0x04, + IrcUserItemType = 0x08 }; + Q_DECLARE_FLAGS(itemTypes, itemType); NetworkModel(QObject *parent = 0); static QList defaultHeader(); @@ -232,6 +233,7 @@ public: bool isBufferIndex(const QModelIndex &) const; //Buffer *getBufferByIndex(const QModelIndex &) const; + QModelIndex networkIndex(NetworkId networkId); QModelIndex bufferIndex(BufferId bufferId); const Network *networkByIndex(const QModelIndex &index) const; @@ -245,12 +247,12 @@ public slots: void networkRemoved(const NetworkId &networkId); private: - QModelIndex networkIndex(NetworkId networkId); NetworkItem *networkItem(NetworkId networkId); NetworkItem *existsNetworkItem(NetworkId networkId); BufferItem *bufferItem(const BufferInfo &bufferInfo); BufferItem *existsBufferItem(const BufferInfo &bufferInfo); }; +Q_DECLARE_OPERATORS_FOR_FLAGS(NetworkModel::itemTypes); #endif // NETWORKMODEL_H