setSortCaseSensitivity(Qt::CaseInsensitive);
// I have this feeling that this resulted in a fuckup once... no clue though right now and invalidateFilter isn't a slot -.-
- connect(model, SIGNAL(invalidateFilter()), this, SLOT(invalidate()));
+ //connect(model, SIGNAL(invalidateFilter()), this, SLOT(invalidate()));
+ connect(model, SIGNAL(invalidateFilter()), this, SLOT(invalidateFilter_()));
+}
+
+void BufferViewFilter::invalidateFilter_() {
+ QSortFilterProxyModel::invalidateFilter();
}
Qt::ItemFlags BufferViewFilter::flags(const QModelIndex &index) const {
if((mode & NoServers) && bufferType == Buffer::StatusType)
return false;
- bool isActive = source_bufferIndex.data(BufferTreeModel::BufferActiveRole).toBool();
- if((mode & NoActive) && isActive)
- return false;
- if((mode & NoInactive) && !isActive)
- return false;
-
- if((mode & FullCustom)) {
- uint bufferuid = source_bufferIndex.data(BufferTreeModel::BufferUidRole).toUInt();
- if(!buffers.contains(bufferuid))
- return false;
- }
+// bool isActive = source_bufferIndex.data(BufferTreeModel::BufferActiveRole).toBool();
+// if((mode & NoActive) && isActive)
+// return false;
+// if((mode & NoInactive) && !isActive)
+// return false;
+
+// if((mode & FullCustom)) {
+// uint bufferuid = source_bufferIndex.data(BufferTreeModel::BufferUidRole).toUInt();
+// if(!buffers.contains(bufferuid))
+// return false;
+// }
return true;
}
public slots:
void removeBuffer(const QModelIndex &);
-
+ void invalidateFilter_();
+
protected:
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
bool lessThan(const QModelIndex &, const QModelIndex &) const;