Don’t adjust time column widths in cf_open
authorStig Bjørlykke <stig@bjorlykke.org>
Thu, 4 Feb 2016 21:00:53 +0000 (22:00 +0100)
committerAnders Broman <a.broman58@gmail.com>
Fri, 5 Feb 2016 05:37:13 +0000 (05:37 +0000)
The time column widths should not be adjusted in cf_open() because
we don’t have any packets yet and Qt resizeColumnToContents() will
not adjust any widths but emits a sectionResized() with invalid or
default values (new_width seems to always be 32).  This will in some
cases (when start capturing packets) give wrong width values which
is later stored in the recent file, and the time columns may end up
narrow the next time the recent file is read.

This fix is related to the column with issues previously compensated
for in PacketList::sectionResized() (g4980d505).

Change-Id: Id3b49069fe5d2b55d608cc7a6d32fe7851369bf9
Reviewed-on: https://code.wireshark.org/review/13712
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
file.c

diff --git a/file.c b/file.c
index cda78b19ed0438fd61084f9a495823c2a7f2e21b..de4b4c045bd159e70efbf00ca8572225d28d5a14 100644 (file)
--- a/file.c
+++ b/file.c
@@ -358,9 +358,6 @@ cf_open(capture_file *cf, const char *fname, unsigned int type, gboolean is_temp
   cf->prev_cap = NULL;
   cf->cum_bytes = 0;
 
-  /* Adjust timestamp precision if auto is selected, col width will be adjusted */
-  cf_timestamp_auto_precision(cf);
-  /* XXX needed ? */
   packet_list_queue_draw();
   cf_callback_invoke(cf_cb_file_opened, cf);