fixing BR #323 - inactive state does no longer overwrite the activity level of queries
authorMarcus Eggenberger <egs@quassel-irc.org>
Sun, 2 Nov 2008 19:17:29 +0000 (20:17 +0100)
committerMarcus Eggenberger <egs@quassel-irc.org>
Sun, 2 Nov 2008 19:17:29 +0000 (20:17 +0100)
src/common/bufferinfo.h
src/qtui/settingspages/bufferviewsettingspage.cpp
src/uisupport/bufferviewfilter.cpp

index fd37329..f5a9f38 100644 (file)
@@ -17,8 +17,8 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-#ifndef _BUFFERINFO_H_
-#define _BUFFERINFO_H_
+#ifndef BUFFERINFO_H
+#define BUFFERINFO_H
 
 #include <QtCore>
 #include "types.h"
index 0f45b2c..65d3229 100644 (file)
@@ -89,8 +89,7 @@ void BufferViewSettingsPage::reset() {
 
   _deleteBufferViews.clear();
 
-  bool _useBufferViewHint;
-  int _bufferViewHint;
+  _useBufferViewHint = false;
 
   setChangedState(false);
 }
index 5899853..5727d34 100644 (file)
@@ -216,7 +216,7 @@ bool BufferViewFilter::filterAcceptBuffer(const QModelIndex &source_bufferIndex)
   if(!(config()->allowedBufferTypes() & (BufferInfo::Type)source_bufferIndex.data(NetworkModel::BufferTypeRole).toInt()))
     return false;
 
-  if(config()->hideInactiveBuffers() && !source_bufferIndex.data(NetworkModel::ItemActiveRole).toBool())
+  if(config()->hideInactiveBuffers() && !source_bufferIndex.data(NetworkModel::ItemActiveRole).toBool() && activityLevel <= BufferInfo::OtherActivity)
     return false;
 
   if(config()->minimumActivity() > activityLevel) {
@@ -302,9 +302,6 @@ QVariant BufferViewFilter::data(const QModelIndex &index, int role) const {
 }
 
 QVariant BufferViewFilter::foreground(const QModelIndex &index) const {
-  if(!index.data(NetworkModel::ItemActiveRole).toBool())
-    return _FgColorInactiveActivity;
-
   BufferInfo::ActivityLevel activity = (BufferInfo::ActivityLevel)index.data(NetworkModel::BufferActivityRole).toInt();
 
   if(activity & BufferInfo::Highlight)
@@ -314,6 +311,9 @@ QVariant BufferViewFilter::foreground(const QModelIndex &index) const {
   if(activity & BufferInfo::OtherActivity)
     return _FgColorOtherActivity;
 
+  if(!index.data(NetworkModel::ItemActiveRole).toBool())
+    return _FgColorInactiveActivity;
+
   return _FgColorNoActivity;
 }