X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.h;h=961c1ca3698fa536597fd7d4279402b15c0e903f;hb=8010224cf5bfe5685dc2cf535e8dc1ec19c4c364;hp=8c36233f8ceb9b5aabd62a0b6340dc82946450c2;hpb=1f02b7201ab7b86238e705d2ce5b22f50bf6acfe;p=quassel.git diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index 8c36233f..961c1ca3 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -62,23 +62,15 @@ public: QString bufferName() const; QString topic() const; int nickCount() const; - + bool isStatusBuffer() const; BufferInfo::Type bufferType() const; bool isActive() const; - - enum Activity { - NoActivity = 0x00, - OtherActivity = 0x01, - NewMessage = 0x02, - Highlight = 0x40 - }; - Q_DECLARE_FLAGS(ActivityLevel, Activity) - ActivityLevel activity() const; - bool setActivity(const ActivityLevel &level); - void updateActivity(const ActivityLevel &level); + inline Buffer::ActivityLevel activityLevel() const { return _activity; } + bool setActivityLevel(Buffer::ActivityLevel level); + void updateActivityLevel(Buffer::ActivityLevel level); void setLastMsgInsert(QDateTime msgDate); bool setLastSeen(); @@ -92,20 +84,18 @@ public slots: void addUserToCategory(IrcUser *ircUser); void removeUserFromCategory(IrcUser *ircUser); void userModeChanged(IrcUser *ircUser); - + private slots: void ircChannelDestroyed(); void ircUserDestroyed(); - + private: BufferInfo _bufferInfo; - ActivityLevel _activity; - QDateTime _lastMsgInsert; - QDateTime _lastSeen; + Buffer::ActivityLevel _activity; QPointer _ircChannel; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(BufferItem::ActivityLevel) + /***************************************** * Network Items @@ -215,8 +205,7 @@ public: BufferIdRole, NetworkIdRole, BufferInfoRole, - ItemTypeRole, - LastSeenRole + ItemTypeRole }; enum itemTypes { @@ -225,7 +214,7 @@ public: UserCategoryItemType, IrcUserItemType }; - + NetworkModel(QObject *parent = 0); static QList defaultHeader(); @@ -244,9 +233,11 @@ public: const Network *networkByIndex(const QModelIndex &index) const; + Buffer::ActivityLevel bufferActivity(const BufferInfo &buffer) const; + public slots: void bufferUpdated(BufferInfo bufferInfo); - void updateBufferActivity(const Message &msg); + void setBufferActivity(const BufferInfo &buffer, Buffer::ActivityLevel activity); void networkRemoved(const NetworkId &networkId); private: