_FgColorInactiveActivity = s.value("inactiveActivityFG", QVariant(QColor(Qt::gray))).value<QColor>();
_FgColorNoActivity = s.value("noActivityFG", QVariant(QColor(Qt::black))).value<QColor>();
_FgColorHighlightActivity = s.value("highlightActivityFG", QVariant(QColor(Qt::magenta))).value<QColor>();
_FgColorInactiveActivity = s.value("inactiveActivityFG", QVariant(QColor(Qt::gray))).value<QColor>();
_FgColorNoActivity = s.value("noActivityFG", QVariant(QColor(Qt::black))).value<QColor>();
_FgColorHighlightActivity = s.value("highlightActivityFG", QVariant(QColor(Qt::magenta))).value<QColor>();
if(_config) {
disconnect(_config, 0, this, 0);
}
if(_config) {
disconnect(_config, 0, this, 0);
}
connect(config(), SIGNAL(bufferViewNameSet(const QString &)), this, SLOT(invalidate()));
connect(config(), SIGNAL(networkIdSet(const NetworkId &)), this, SLOT(invalidate()));
connect(config(), SIGNAL(addNewBuffersAutomaticallySet(bool)), this, SLOT(invalidate()));
connect(config(), SIGNAL(bufferViewNameSet(const QString &)), this, SLOT(invalidate()));
connect(config(), SIGNAL(networkIdSet(const NetworkId &)), this, SLOT(invalidate()));
connect(config(), SIGNAL(addNewBuffersAutomaticallySet(bool)), this, SLOT(invalidate()));
void BufferViewFilter::addBuffer(const BufferId &bufferId) const {
if(!config() || config()->bufferList().contains(bufferId))
return;
void BufferViewFilter::addBuffer(const BufferId &bufferId) const {
if(!config() || config()->bufferList().contains(bufferId))
return;
lt = bufferIdLessThan(bufferId, config()->bufferList()[i]);
else
lt = bufferId < config()->bufferList()[i];
lt = bufferIdLessThan(bufferId, config()->bufferList()[i]);
else
lt = bufferId < config()->bufferList()[i];
// add the buffer if...
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)...
// add the buffer if...
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)...
if(config()->networkId().isValid() && config()->networkId() != sourceModel()->data(source_bufferIndex, NetworkModel::NetworkIdRole).value<NetworkId>())
return false;
if(!(config()->allowedBufferTypes() & (BufferInfo::Type)source_bufferIndex.data(NetworkModel::BufferTypeRole).toInt()))
return false;
if(config()->networkId().isValid() && config()->networkId() != sourceModel()->data(source_bufferIndex, NetworkModel::NetworkIdRole).value<NetworkId>())
return false;
if(!(config()->allowedBufferTypes() & (BufferInfo::Type)source_bufferIndex.data(NetworkModel::BufferTypeRole).toInt()))
return false;
- if(config()->hideInactiveBuffers() && !source_bufferIndex.data(NetworkModel::ItemActiveRole).toBool())
+ // the following dynamic filters may not trigger if the buffer is currently selected.
+ if(bufferId == Client::bufferModel()->standardSelectionModel()->currentIndex().data(NetworkModel::BufferIdRole).value<BufferId>())
+ return true;
+
+ if(config()->hideInactiveBuffers() && !source_bufferIndex.data(NetworkModel::ItemActiveRole).toBool() && activityLevel <= BufferInfo::OtherActivity)
bool BufferViewFilter::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const {
QModelIndex child = sourceModel()->index(source_row, 0, source_parent);
bool BufferViewFilter::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const {
QModelIndex child = sourceModel()->index(source_row, 0, source_parent);
case NetworkModel::BufferItemType:
return bufferLessThan(source_left, source_right);
default:
case NetworkModel::BufferItemType:
return bufferLessThan(source_left, source_right);
default:
CheckRemovalEvent *removalEvent = static_cast<CheckRemovalEvent *>(event);
checkItemForRemoval(removalEvent->index);
CheckRemovalEvent *removalEvent = static_cast<CheckRemovalEvent *>(event);
checkItemForRemoval(removalEvent->index);
QModelIndex leftIndex = Client::networkModel()->bufferIndex(left);
QModelIndex rightIndex = Client::networkModel()->bufferIndex(right);
QModelIndex leftIndex = Client::networkModel()->bufferIndex(left);
QModelIndex rightIndex = Client::networkModel()->bufferIndex(right);