X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.cpp;h=54387eccb48bb9581aee76d356fecec19f9e1588;hb=19eb49e171a5a39e1ba8d6c92fd97256aeb949e1;hp=7c85dfd87854d62d1a06271d9da79cc38ee0ec4a;hpb=09fea00d02da49748b6a040752759eab16ccd392;p=quassel.git diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index 7c85dfd8..54387ecc 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -47,7 +47,7 @@ BufferViewFilter::BufferViewFilter(QAbstractItemModel *model, BufferViewConfig * _config(0), _sortOrder(Qt::AscendingOrder), _userOfflineIcon(SmallIcon("user-offline")), - _userAwayIcon(SmallIcon("user-away")), + _userAwayIcon(SmallIcon("user-away-extended")), _userOnlineIcon(SmallIcon("user-online")), _editMode(false), _enableEditMode(tr("Edit Mode"), this) @@ -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;