#include "selectionmodelsynchronizer.h"
#include "modelpropertymapper.h"
+#include "clientsettings.h"
+
class MappedSelectionModel;
class QAbstractItemView;
class Network;
QString bufferName() const;
QString topic() const;
int nickCount() const;
-
- enum Type {
- StatusType,
- ChannelType,
- QueryType
- };
bool isStatusBuffer() const;
- Type bufferType() const;
+ BufferInfo::Type bufferType() const;
bool isActive() const;
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);
private slots:
void ircChannelDestroyed();
+ void ircUserDestroyed();
private:
BufferInfo _bufferInfo;
ActivityLevel _activity;
- Type _type;
+ QDateTime _lastMsgInsert;
+ QDateTime _lastSeen;
QPointer<IrcChannel> _ircChannel;
};
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;
void setNick(QString newNick);
private:
- IrcUser *_ircUser;
+ QPointer<IrcUser> _ircUser;
+ quint64 _id;
};
BufferIdRole,
NetworkIdRole,
BufferInfoRole,
- ItemTypeRole
+ ItemTypeRole,
+ LastSeenRole
};
enum itemTypes {
//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);