- if(index.data(NetworkModel::BufferTypeRole).toInt() != BufferInfo::QueryBuffer)
- return QVariant();
-
- if(!index.data(NetworkModel::ItemActiveRole).toBool())
- return _userOfflineIcon;
-
- if(index.data(NetworkModel::UserAwayRole).toBool())
- return _userAwayIcon;
- else
- return _userOnlineIcon;
-
- return QVariant();
-}
-
-QVariant BufferViewFilter::foreground(const QModelIndex &index) const {
- if(config() && config()->disableDecoration())
- return _FgColorNoActivity;
-
- BufferInfo::ActivityLevel activity = (BufferInfo::ActivityLevel)index.data(NetworkModel::BufferActivityRole).toInt();
-
- if(activity & BufferInfo::Highlight)
- return _FgColorHighlightActivity;
- if(activity & BufferInfo::NewMessage)
- return _FgColorNewMessageActivity;
- if(activity & BufferInfo::OtherActivity)
- return _FgColorOtherActivity;
+ QModelIndex source_index = mapToSource(index);
+ NetworkModel::ItemType itemType = (NetworkModel::ItemType)sourceModel()->data(source_index, NetworkModel::ItemTypeRole).toInt();
+ BufferInfo::Type bufferType = (BufferInfo::Type)sourceModel()->data(source_index, NetworkModel::BufferTypeRole).toInt();
+ bool isActive = sourceModel()->data(source_index, NetworkModel::ItemActiveRole).toBool();