summaryrefslogtreecommitdiff
path: root/ui/qt/capture_file_properties_dialog.cpp
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-06-05 17:21:23 -0700
committerGuy Harris <guy@alum.mit.edu>2016-06-06 00:22:21 +0000
commitadee6850898a5469850a157c5816996691855ed2 (patch)
tree099a9d5fb77c490b5b6b05fc539e1208223327d3 /ui/qt/capture_file_properties_dialog.cpp
parent56e33a549f54038e9155c781bb2097fe30d4b2dc (diff)
downloadwireshark-adee6850898a5469850a157c5816996691855ed2.tar.gz
Directly use wtap_opttypes calls to fetch SHB options.
Don't put them in the summary structure; the summary routines should calculate summary statistics, not dig up every bit of information that *could* appear in a summary. Instead, have the GUI code call wtap_file_get_shb() to get the SHB information and call wtap_optionblock_get_option_string() to fetch the option values. Move the option code definitions into wtap_opttypes.h, as they're used by the API. Change-Id: Icef11f5fb30fdc3df1bb0208aae9ed0aebaf0182 Reviewed-on: https://code.wireshark.org/review/15748 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/qt/capture_file_properties_dialog.cpp')
-rw-r--r--ui/qt/capture_file_properties_dialog.cpp60
1 files changed, 34 insertions, 26 deletions
diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp
index 2d0ff87e60..59c5bcf6d2 100644
--- a/ui/qt/capture_file_properties_dialog.cpp
+++ b/ui/qt/capture_file_properties_dialog.cpp
@@ -242,33 +242,41 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
out << section_tmpl_.arg(tr("Capture"));
out << table_begin;
- QString capture_hardware(unknown);
- if (summary.shb_hardware && summary.shb_hardware[0] != '\0') {
- capture_hardware = summary.shb_hardware;
+ wtap_optionblock_t shb_inf = wtap_file_get_shb(cap_file_.capFile()->wth);
+ char *str;
+
+ if (shb_inf != NULL) {
+ QString capture_hardware(unknown);
+ wtap_optionblock_get_option_string(shb_inf, OPT_SHB_HARDWARE, &str);
+ if (str != NULL && str[0] != '\0') {
+ capture_hardware = str;
+ }
+ // capture HW
+ out << table_row_begin
+ << table_vheader_tmpl.arg(tr("Hardware"))
+ << table_data_tmpl.arg(capture_hardware)
+ << table_row_end;
+
+ QString capture_os(unknown);
+ wtap_optionblock_get_option_string(shb_inf, OPT_SHB_OS, &str);
+ if (str != NULL && str[0] != '\0') {
+ capture_os = str;
+ }
+ out << table_row_begin
+ << table_vheader_tmpl.arg(tr("OS"))
+ << table_data_tmpl.arg(capture_os)
+ << table_row_end;
+
+ QString capture_app(unknown);
+ wtap_optionblock_get_option_string(shb_inf, OPT_SHB_USERAPPL, &str);
+ if (str != NULL && str[0] != '\0') {
+ capture_app = str;
+ }
+ out << table_row_begin
+ << table_vheader_tmpl.arg(tr("Application"))
+ << table_data_tmpl.arg(capture_app)
+ << table_row_end;
}
- // capture HW
- out << table_row_begin
- << table_vheader_tmpl.arg(tr("Hardware"))
- << table_data_tmpl.arg(capture_hardware)
- << table_row_end;
-
- QString capture_os(unknown);
- if (summary.shb_os && summary.shb_os[0] != '\0') {
- capture_os = summary.shb_os;
- }
- out << table_row_begin
- << table_vheader_tmpl.arg(tr("OS"))
- << table_data_tmpl.arg(capture_os)
- << table_row_end;
-
- QString capture_app(unknown);
- if (summary.shb_user_appl && summary.shb_user_appl[0] != '\0') {
- capture_app = summary.shb_user_appl;
- }
- out << table_row_begin
- << table_vheader_tmpl.arg(tr("Application"))
- << table_data_tmpl.arg(capture_app)
- << table_row_end;
out << table_end;