+/*
+void BufferItem::setLastMsgInsert(QDateTime msgDate) {
+ if(msgDate.isValid() && msgDate > _lastMsgInsert)
+ _lastMsgInsert = msgDate;
+}
+*/
+/*
+// FIXME emit dataChanged()
+bool BufferItem::setLastSeen() {
+ if(_lastSeen > _lastMsgInsert)
+ return false;
+
+ _lastSeen = _lastMsgInsert;
+ BufferSettings(bufferInfo().bufferId()).setLastSeen(_lastSeen);
+ return true;
+}
+
+QDateTime BufferItem::lastSeen() {
+ return _lastSeen;
+}
+*/
+
+
+/*****************************************
+* User Category Items (like @vh etc.)
+*****************************************/
+// we hardcode this even though we have PREFIX in network... but that wouldn't help with mapping modes to
+// category strings anyway.
+const QList<QChar> UserCategoryItem::categories = QList<QChar>() << 'q' << 'a' << 'o' << 'h' << 'v';
+
+UserCategoryItem::UserCategoryItem(int category, AbstractTreeItem *parent)
+ : PropertyMapItem(QStringList() << "categoryName", parent),
+ _category(category)
+{
+}
+
+// caching this makes no sense, since we display the user number dynamically
+QString UserCategoryItem::categoryName() const {
+ int n = childCount();
+ switch(_category) {
+ case 0: return tr("%n Owner(s)", 0, n);
+ case 1: return tr("%n Admin(s)", 0, n);
+ case 2: return tr("%n Operator(s)", 0, n);
+ case 3: return tr("%n Half-Op(s)", 0, n);
+ case 4: return tr("%n Voiced", 0, n);
+ default: return tr("%n User(s)", 0, n);
+ }
+}
+
+quint64 UserCategoryItem::id() const {
+ return qHash(_category);
+}
+
+void UserCategoryItem::addUsers(const QList<IrcUser *> &ircUsers) {
+ QList<AbstractTreeItem *> userItems;
+ foreach(IrcUser *ircUser, ircUsers)
+ userItems << new IrcUserItem(ircUser, this);
+ newChilds(userItems);