the new chatwidget now highlights the first new message since your last visit (curren...
[quassel.git] / src / client / messagefilter.cpp
index 0c35ee9..543d1fc 100644 (file)
 
 #include "messagefilter.h"
 
+MessageFilter::MessageFilter(QAbstractItemModel *source, QObject *parent) : QSortFilterProxyModel(parent) {
+  setSourceModel(source);
+}
+
 MessageFilter::MessageFilter(MessageModel *source, const QList<BufferId> &buffers, QObject *parent)
   : QSortFilterProxyModel(parent),
     _bufferList(buffers)
 {
   setSourceModel(source);
+}
 
+QString MessageFilter::idString() const {
+  if(_bufferList.isEmpty()) return "*";
+  QString idstr;
+  QStringList bufids;
+  foreach(BufferId id, _bufferList) bufids << QString::number(id.toInt());
+  bufids.sort();
+  foreach(QString id, bufids) idstr += id + '|';
+  idstr.chop(1);
+  return idstr;
 }
 
 bool MessageFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {