X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.cpp;h=1778490ce10cb71f57a939220e84dfc333c5265a;hp=bb67e506048a9f2edfcbd1339e1fe7266b7c2932;hb=b3ec58929bead822048a25f87f6a0d699c490b7a;hpb=73696998505c35c02bd019f78e9f502cbc36da5b diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index bb67e506..1778490c 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 * @@ -31,8 +31,6 @@ #include "iconloader.h" #include "networkmodel.h" -#include "uisettings.h" - class CheckRemovalEvent : public QEvent { public: CheckRemovalEvent(const QModelIndex &source_index) : QEvent(QEvent::User), index(source_index) {}; @@ -47,7 +45,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) @@ -57,8 +55,6 @@ BufferViewFilter::BufferViewFilter(QAbstractItemModel *model, BufferViewConfig * setDynamicSortFilter(true); - loadColors(); - connect(this, SIGNAL(_dataChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex))); @@ -71,15 +67,6 @@ BufferViewFilter::BufferViewFilter(QAbstractItemModel *model, BufferViewConfig * bufferSettings.notify("ShowUserStateIcons", this, SLOT(showUserStateIconsChanged())); } -void BufferViewFilter::loadColors() { - UiSettings s("QtUiStyle/Colors"); - _FgColorInactiveActivity = s.value("inactiveActivityFG", QVariant(QColor(Qt::gray))).value(); - _FgColorNoActivity = s.value("noActivityFG", QVariant(QColor(Qt::black))).value(); - _FgColorHighlightActivity = s.value("highlightActivityFG", QVariant(QColor(Qt::magenta))).value(); - _FgColorNewMessageActivity = s.value("newMessageActivityFG", QVariant(QColor(Qt::green))).value(); - _FgColorOtherActivity = s.value("otherActivityFG", QVariant(QColor(Qt::darkGreen))).value(); -} - void BufferViewFilter::showUserStateIconsChanged() { BufferSettings bufferSettings; _showUserStateIcons = bufferSettings.showUserStateIcons(); @@ -371,8 +358,6 @@ QVariant BufferViewFilter::data(const QModelIndex &index, int role) const { switch(role) { case Qt::DecorationRole: return icon(index); - case Qt::ForegroundRole: - return foreground(index); case Qt::CheckStateRole: return checkedState(index); default: @@ -401,25 +386,6 @@ QVariant BufferViewFilter::icon(const QModelIndex &index) const { 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; - - if(!index.data(NetworkModel::ItemActiveRole).toBool() || index.data(NetworkModel::UserAwayRole).toBool()) - return _FgColorInactiveActivity; - - return _FgColorNoActivity; -} - QVariant BufferViewFilter::checkedState(const QModelIndex &index) const { if(!_editMode || !config()) return QVariant();