Have ConversationDialog retain data between captures.
authorGerald Combs <gerald@zing.org>
Sun, 3 Aug 2014 02:31:33 +0000 (19:31 -0700)
committerGerald Combs <gerald@wireshark.org>
Sun, 3 Aug 2014 02:36:10 +0000 (02:36 +0000)
Remove our tap listeners when the capture file closes. This lets us view
conversation data for multiple capture files.
Change-Id: Ifaa1d2c9d3cd10b1d282aa0070ee2edacc7ce3b0
Reviewed-on: https://code.wireshark.org/review/3376
Reviewed-by: Gerald Combs <gerald@wireshark.org>
ui/qt/conversation_dialog.cpp

index b49f19763bae200eb4a618e63671e69a60274d8e..bb76c8793f849fef855db4a28b784aed9473b9e2 100644 (file)
@@ -40,6 +40,7 @@
 #include <QList>
 #include <QMap>
 #include <QMessageBox>
+#include <QPushButton>
 #include <QTabWidget>
 #include <QTextStream>
 #include <QToolButton>
@@ -179,7 +180,12 @@ void ConversationDialog::setCaptureFile(capture_file *cf)
 {
     if (!cf) { // We only want to know when the file closes.
         cap_file_ = NULL;
+        for (int i = 0; i < ui->conversationTabWidget->count(); i++) {
+            ConversationTreeWidget *cur_tree = qobject_cast<ConversationTreeWidget *>(ui->conversationTabWidget->widget(i));
+            remove_tap_listener(cur_tree->conversationHash());
+        }
         ui->displayFilterCheckBox->setEnabled(false);
+        ui->conversationTypePushButton->setEnabled(false);
     }
 }