X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.cpp;h=bb67e506048a9f2edfcbd1339e1fe7266b7c2932;hp=7c85dfd87854d62d1a06271d9da79cc38ee0ec4a;hb=73696998505c35c02bd019f78e9f502cbc36da5b;hpb=09fea00d02da49748b6a040752759eab16ccd392 diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index 7c85dfd8..bb67e506 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -97,6 +97,7 @@ void BufferViewFilter::setConfig(BufferViewConfig *config) { if(!config) { invalidate(); + setObjectName(""); return; } @@ -127,6 +128,8 @@ void BufferViewFilter::configInitialized() { disconnect(config(), SIGNAL(initDone()), this, SLOT(configInitialized())); + setObjectName(config()->bufferViewName()); + invalidate(); emit configChanged(); } @@ -281,7 +284,10 @@ bool BufferViewFilter::filterAcceptBuffer(const QModelIndex &source_bufferIndex) if(config()->networkId().isValid() && config()->networkId() != source_bufferIndex.data(NetworkModel::NetworkIdRole).value()) return false; - if(!(config()->allowedBufferTypes() & (BufferInfo::Type)source_bufferIndex.data(NetworkModel::BufferTypeRole).toInt())) + int allowedBufferTypes = config()->allowedBufferTypes(); + if(!config()->networkId().isValid()) + allowedBufferTypes &= ~BufferInfo::StatusBuffer; + if(!(allowedBufferTypes & source_bufferIndex.data(NetworkModel::BufferTypeRole).toInt())) return false; // the following dynamic filters may not trigger if the buffer is currently selected. @@ -496,10 +502,7 @@ void BufferViewFilter::checkItemsForRemoval(const QModelIndex &topLeft, const QM emit _dataChanged(source_topLeft, source_bottomRight); } -// ****************************** -// Helper -// ****************************** -bool bufferIdLessThan(const BufferId &left, const BufferId &right) { +bool BufferViewFilter::bufferIdLessThan(const BufferId &left, const BufferId &right) { Q_CHECK_PTR(Client::networkModel()); if(!Client::networkModel()) return true;