Message object cleanup
[quassel.git] / src / uisupport / networkmodelactionprovider.cpp
index 84a306c..6061e38 100644 (file)
@@ -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  *
@@ -504,10 +504,11 @@ void NetworkModelActionProvider::handleBufferAction(ActionType type, QAction *)
 void NetworkModelActionProvider::removeBuffers(const QModelIndexList &indexList) {
   QList<BufferInfo> inactive;
   foreach(QModelIndex index, indexList) {
-    if(!index.data(NetworkModel::ItemActiveRole).toBool()) {
-      BufferInfo info = index.data(NetworkModel::BufferInfoRole).value<BufferInfo>();
-      if(info.isValid())
-        inactive << info;
+    BufferInfo info = index.data(NetworkModel::BufferInfoRole).value<BufferInfo>();
+    if(info.isValid()) {
+      if(info.type() == BufferInfo::QueryBuffer
+        || (info.type() == BufferInfo::ChannelBuffer && !index.data(NetworkModel::ItemActiveRole).toBool()))
+          inactive << info;
     }
   }
   QString msg;