X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.cpp;h=5a026c99fd5995882ae71bb257012be8916f1bc0;hp=dfad3c21affe14b628b5cc64a5abb4fb704b6181;hb=46d75f41de7c1aaee605c096da28d4b0d8abf138;hpb=17331c42de77ff91ce297354f9ba9eed6ecb4256 diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index dfad3c21..5a026c99 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -262,7 +262,8 @@ bool BufferViewFilter::filterAcceptBuffer(const QModelIndex &source_bufferIndex) if(!config()->bufferList().contains(bufferId) && !_editMode) { // add the buffer if... - if(config()->isInitialized() && !config()->removedBuffers().contains(bufferId) // it hasn't been manually removed and either + if(config()->isInitialized() + && !config()->removedBuffers().contains(bufferId) // it hasn't been manually removed and either && ((config()->addNewBuffersAutomatically() && !config()->temporarilyRemovedBuffers().contains(bufferId)) // is totally unknown to us (a new buffer)... || (config()->temporarilyRemovedBuffers().contains(bufferId) && activityLevel > BufferInfo::OtherActivity))) { // or was just temporarily hidden and has a new message waiting for us. addBuffer(bufferId); @@ -313,10 +314,15 @@ bool BufferViewFilter::filterAcceptsRow(int source_row, const QModelIndex &sourc return false; } - if(!source_parent.isValid()) + NetworkModel::ItemType childType = (NetworkModel::ItemType)sourceModel()->data(child, NetworkModel::ItemTypeRole).toInt(); + switch(childType) { + case NetworkModel::NetworkItemType: return filterAcceptNetwork(child); - else + case NetworkModel::BufferItemType: return filterAcceptBuffer(child); + default: + return false; + } } bool BufferViewFilter::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const { @@ -377,6 +383,9 @@ QVariant BufferViewFilter::icon(const QModelIndex &index) const { return QVariant(); QModelIndex source_index = mapToSource(index); + if(sourceModel()->data(source_index, NetworkModel::ItemTypeRole).toInt() != NetworkModel::BufferItemType) + return QVariant(); + if(sourceModel()->data(source_index, NetworkModel::BufferTypeRole).toInt() != BufferInfo::QueryBuffer) return QVariant();