+
+bool BufferViewFilter::filterAcceptNetwork(const QModelIndex &source_index) const {
+ QString net = source_index.data(Qt::DisplayRole).toString();
+ if((mode & SomeNets) && !networks.contains(net))
+ return false;
+ else
+ return true;
+}
+
+bool BufferViewFilter::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const {
+ QModelIndex child = sourceModel()->index(source_row, 0, source_parent);
+
+ if(!child.isValid()) {
+ qDebug() << "filterAcceptsRow has been called with an invalid Child";
+ return false;
+ }
+
+ if(source_parent == QModelIndex())
+ return filterAcceptNetwork(child);
+ else
+ return filterAcceptBuffer(child);
+}
+
+bool BufferViewFilter::lessThan(const QModelIndex &left, const QModelIndex &right) {
+ return QSortFilterProxyModel::lessThan(left, right);
+}
+