Qt: Keep byte tab when reloading/closing capture file
authorPeter Wu <peter@lekensteyn.nl>
Wed, 30 Mar 2016 22:03:35 +0000 (00:03 +0200)
committerPeter Wu <peter@lekensteyn.nl>
Sat, 2 Apr 2016 21:17:18 +0000 (21:17 +0000)
Do not remove byte view on closing a capture file. For this to work, the
tree items must also be remembered.

Change-Id: Ice5cd1006b957e2d1331effc15c4c0a9de89916d
Reviewed-on: https://code.wireshark.org/review/14715
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
ui/qt/packet_dialog.cpp

index a8e26f217f9898e5b8a0ae8ba0cfbe4fbc1c40fc..0d19f9a59e4b3b12003e3237e6456832cfe4deb7 100644 (file)
@@ -38,8 +38,6 @@
 #include <QTreeWidgetItemIterator>
 
 // To do:
-// - Don't hide the byte view when we reload.
-// - Find a way to preserve the byte view after the file closes.
 // - Copy over experimental packet editing code.
 // - Fix ElidedText width.
 
@@ -118,16 +116,6 @@ PacketDialog::~PacketDialog()
 
 void PacketDialog::captureFileClosing()
 {
-    delete byte_view_tab_;
-    byte_view_tab_ = NULL;
-
-    QTreeWidgetItemIterator iter(proto_tree_);
-    while (*iter) {
-        QTreeWidgetItem *item = (*iter);
-        item->setData(0, Qt::UserRole, QVariant());
-        ++iter;
-    }
-
     QString closed_title = tr("[%1 closed] " UTF8_MIDDLE_DOT " %2")
             .arg(cap_file_.fileName())
             .arg(col_info_);