X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.h;h=c3dbaf472480208f9c80277524240c1cbe9dedaa;hb=016e582df39899c1356e4023ebc5a4b28a2e57ee;hp=7bd7219c8f08a1fa6e9421a456877ff3c6469d7c;hpb=5d9e6f82037c37c560827bfd9d71bc9467fa7ccc;p=quassel.git diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index 7bd7219c..c3dbaf47 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -32,6 +32,8 @@ class BufferInfo; #include "selectionmodelsynchronizer.h" #include "modelpropertymapper.h" +#include "clientsettings.h" + class MappedSelectionModel; class QAbstractItemView; class Network; @@ -81,9 +83,13 @@ public: Q_DECLARE_FLAGS(ActivityLevel, Activity) ActivityLevel activity() const; - void setActivity(const ActivityLevel &level); + bool setActivity(const ActivityLevel &level); void updateActivity(const ActivityLevel &level); + void setLastMsgInsert(QDateTime msgDate); + bool setLastSeen(); + QDateTime lastSeen(); + public slots: void setTopic(const QString &topic); void join(IrcUser *ircUser); @@ -95,11 +101,14 @@ public slots: private slots: void ircChannelDestroyed(); + void ircUserDestroyed(); private: BufferInfo _bufferInfo; ActivityLevel _activity; Type _type; + QDateTime _lastMsgInsert; + QDateTime _lastSeen; QPointer _ircChannel; }; @@ -183,6 +192,8 @@ public: IrcUserItem(IrcUser *ircUser, AbstractTreeItem *parent); QString nickName() const; + bool isActive() const; + IrcUser *ircUser(); virtual quint64 id() const; virtual QVariant data(int column, int role) const; @@ -192,7 +203,8 @@ private slots: void setNick(QString newNick); private: - IrcUser *_ircUser; + QPointer _ircUser; + quint64 _id; }; @@ -210,7 +222,8 @@ public: BufferIdRole, NetworkIdRole, BufferInfoRole, - ItemTypeRole + ItemTypeRole, + LastSeenRole }; enum itemTypes { @@ -236,10 +249,13 @@ public: //Buffer *getBufferByIndex(const QModelIndex &) const; QModelIndex bufferIndex(BufferId bufferId); + const Network *networkByIndex(const QModelIndex &index) const; + public slots: void bufferUpdated(BufferInfo bufferInfo); void updateBufferActivity(const Message &msg); - + void networkRemoved(const NetworkId &networkId); + private: QModelIndex networkIndex(NetworkId networkId); NetworkItem *networkItem(NetworkId networkId);