X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewoverlayfilter.cpp;h=4309ee91b859217b88554af93f42a6646d039655;hp=97a3246e563ec165f620028668e2e0d28e167456;hb=925149e4675223754de4962b95728b76647d4949;hpb=71ef3ec0c4c4d02431aa560ed83b379c416798c5 diff --git a/src/uisupport/bufferviewoverlayfilter.cpp b/src/uisupport/bufferviewoverlayfilter.cpp index 97a3246e..4309ee91 100644 --- a/src/uisupport/bufferviewoverlayfilter.cpp +++ b/src/uisupport/bufferviewoverlayfilter.cpp @@ -69,18 +69,20 @@ bool BufferViewOverlayFilter::filterAcceptsRow(int source_row, const QModelIndex return false; } - NetworkId networkId = sourceModel()->data(source_bufferIndex, NetworkModel::NetworkIdRole).value(); - if(!_overlay->networkIds().contains(networkId) && ! _overlay->allNetworks()) + NetworkModel::ItemType itemType = (NetworkModel::ItemType)sourceModel()->data(source_bufferIndex, NetworkModel::ItemTypeRole).toInt(); + + NetworkId networkId = sourceModel()->data(source_bufferIndex, NetworkModel::NetworkIdRole).value(); + if(!_overlay->networkIds().contains(networkId) && ! _overlay->allNetworks()) { return false; + } else if(itemType == NetworkModel::NetworkItemType) { + // network items don't need further checks. + return true; + } int activityLevel = sourceModel()->data(source_bufferIndex, NetworkModel::BufferActivityRole).toInt(); if(_overlay->minimumActivity() > activityLevel) return false; - bool isActive = sourceModel()->data(source_bufferIndex, NetworkModel::ItemActiveRole).toBool(); - if(_overlay->hideInactiveBuffers() && !isActive && activityLevel <= BufferInfo::OtherActivity) - return false; - int bufferType = sourceModel()->data(source_bufferIndex, NetworkModel::BufferTypeRole).toInt(); if(!(_overlay->allowedBufferTypes() & bufferType)) return false; @@ -98,6 +100,7 @@ bool BufferViewOverlayFilter::filterAcceptsRow(int source_row, const QModelIndex return false; // the buffer is not known to us - return _overlay->addBuffersAutomatically(); + qDebug() << "BufferViewOverlayFilter::filterAcceptsRow()" << bufferId << "is unknown!"; + return false; }