Enable plain old QTimer-based asynchronous message processing. More fancy stuff will...
[quassel.git] / src / client / messagefilter.cpp
index 0c35ee9..e375b2e 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)
@@ -28,6 +32,17 @@ MessageFilter::MessageFilter(MessageModel *source, const QList<BufferId> &buffer
 
 }
 
+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 {
   Q_UNUSED(sourceParent);
   if(_bufferList.isEmpty()) return true;