aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2015-12-06 21:52:29 -0500
committerAnders Broman <a.broman58@gmail.com>2015-12-09 17:03:37 +0000
commit3ba0e88bb875c05b083fcb47969c471cbc297bff (patch)
tree786c4f0df4a9defe87f9849ae51d32c5b114e89d /file.c
parent7e06334a87faf64c58a8dbc916480027a21a3aef (diff)
Update the packets bar periodically when loading a (large) file.
Update the packet bar each time we update the progress bar: 1) in the Qt UI 2) (and) in the Gtk UI if auto_scroll_live wasn't set 3) (and) even if we don't HAVE_LIBPCAP This allows the user to watch the number of packets increasing. (Extracted from I02c46b086f34a026b7980458f2a93d0d70cac23b.) Change-Id: I47a7a2b0dc6da50035098ab0b0eb0d55f7484960 Reviewed-on: https://code.wireshark.org/review/12459 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'file.c')
-rw-r--r--file.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/file.c b/file.c
index b3b9fdf96a..05bca69949 100644
--- a/file.c
+++ b/file.c
@@ -567,9 +567,6 @@ cf_read(capture_file *cf, gboolean reloading)
epan_dissect_init(&edt, cf->epan, create_proto_tree, FALSE);
TRY {
-#ifdef HAVE_LIBPCAP
- int displayed_once = 0;
-#endif
int count = 0;
gint64 size;
@@ -626,15 +623,8 @@ cf_read(capture_file *cf, gboolean reloading)
if (progbar != NULL) {
progbar_val = calc_progbar_val(cf, size, file_pos, status_str, sizeof(status_str));
/* update the packet bar content on the first run or frequently on very large files */
-#ifdef HAVE_LIBPCAP
- if (progbar_quantum > 500000 || displayed_once == 0) {
- if ((auto_scroll_live || displayed_once == 0 || cf->displayed_count < 1000) && cf->count != 0) {
- displayed_once = 1;
- packets_bar_update();
- }
- }
-#endif /* HAVE_LIBPCAP */
update_progress_dlg(progbar, progbar_val, status_str);
+ packets_bar_update();
}
progbar_nextstep += progbar_quantum;
}
@@ -4138,9 +4128,6 @@ rescan_file(capture_file *cf, const char *fname, gboolean is_tempfile, int *err)
guint32 framenum;
frame_data *fdata;
int count = 0;
-#ifdef HAVE_LIBPCAP
- int displayed_once = 0;
-#endif
/* Close the old handle. */
wtap_close(cf->wth);
@@ -4236,15 +4223,8 @@ rescan_file(capture_file *cf, const char *fname, gboolean is_tempfile, int *err)
if (progbar != NULL) {
progbar_val = calc_progbar_val(cf, size, cf->f_datalen, status_str, sizeof(status_str));
/* update the packet bar content on the first run or frequently on very large files */
-#ifdef HAVE_LIBPCAP
- if (progbar_quantum > 500000 || displayed_once == 0) {
- if ((auto_scroll_live || displayed_once == 0 || cf->displayed_count < 1000) && cf->count != 0) {
- displayed_once = 1;
- packets_bar_update();
- }
- }
-#endif /* HAVE_LIBPCAP */
update_progress_dlg(progbar, progbar_val, status_str);
+ packets_bar_update();
}
progbar_nextstep += progbar_quantum;
}