aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2017-06-19 14:48:42 -0400
committerAnders Broman <a.broman58@gmail.com>2017-06-19 23:49:24 +0000
commitbef90e1493815a07e619c4cd0da6a7d65321c26e (patch)
tree373e36b249a2f9f0e140af20f58bc4770e19f8b5
parent246cbbc2ea6dd0a3a69a1aaa94db244a77565353 (diff)
Update the capture file load time each time we update the progress bar.
The Qt UI doesn't have a popup that tells you how long your file has been loading. So let's set the load time each time we update the packets bar. (Obviously this is only useful when you're waiting a long time for a file to load...) Change-Id: I9da372800a12454888439e2baf3d2a848c611501 Reviewed-on: https://code.wireshark.org/review/22234 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>
-rw-r--r--cfile.h2
-rw-r--r--file.c2
-rw-r--r--file.h2
3 files changed, 4 insertions, 2 deletions
diff --git a/cfile.h b/cfile.h
index 2a22a13975..f2fb5794af 100644
--- a/cfile.h
+++ b/cfile.h
@@ -125,7 +125,7 @@ typedef struct _capture_file {
#endif
gpointer window; /* Top-level window associated with file */
GTree *frames_user_comments; /* BST with user comments for frames (key = frame_data) */
- gulong computed_elapsed;
+ gulong computed_elapsed; /* Elapsed time to load the file (in msec). */
guint32 cum_bytes;
const frame_data *ref;
diff --git a/file.c b/file.c
index b8423cca71..c9e968005e 100644
--- a/file.c
+++ b/file.c
@@ -638,6 +638,7 @@ cf_read(capture_file *cf, gboolean reloading)
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 */
update_progress_dlg(progbar, progbar_val, status_str);
+ compute_elapsed(cf, &start_time);
packets_bar_update();
g_timer_start(prog_timer);
}
@@ -4292,6 +4293,7 @@ rescan_file(capture_file *cf, const char *fname, gboolean is_tempfile)
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 */
update_progress_dlg(progbar, progbar_val, status_str);
+ compute_elapsed(cf, &start_time);
packets_bar_update();
g_timer_start(prog_timer);
}
diff --git a/file.h b/file.h
index 5ff86b60de..20e9282b30 100644
--- a/file.h
+++ b/file.h
@@ -391,7 +391,7 @@ cf_status_t cf_filter_packets(capture_file *cf, gchar *dfilter, gboolean force);
void cf_reftime_packets(capture_file *cf);
/**
- * Return the time it took to load the file
+ * Return the time it took to load the file (in msec).
*/
gulong cf_get_computed_elapsed(capture_file *cf);