Fix an issue where active query buffer couldn't be deleted
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 12 Jan 2009 20:59:11 +0000 (21:59 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 12 Jan 2009 20:59:11 +0000 (21:59 +0100)
src/uisupport/networkmodelactionprovider.cpp

index a4f84e4..6061e38 100644 (file)
@@ -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;