diff options
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/capture_file_properties_dialog.cpp | 23 | ||||
-rw-r--r-- | ui/qt/resolved_addresses_dialog.cpp | 17 |
2 files changed, 29 insertions, 11 deletions
diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp index 59c5bcf6d2..60ce9ddcb1 100644 --- a/ui/qt/capture_file_properties_dialog.cpp +++ b/ui/qt/capture_file_properties_dialog.cpp @@ -242,14 +242,15 @@ QString CaptureFilePropertiesDialog::summaryToHtml() out << section_tmpl_.arg(tr("Capture")); out << table_begin; - wtap_optionblock_t shb_inf = wtap_file_get_shb(cap_file_.capFile()->wth); + wtap_block_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; + if (wtap_block_get_string_option_value(shb_inf, OPT_SHB_HARDWARE, &str) == WTAP_OPTTYPE_SUCCESS) { + if (str != NULL && str[0] != '\0') { + capture_hardware = str; + } } // capture HW out << table_row_begin @@ -258,9 +259,10 @@ QString CaptureFilePropertiesDialog::summaryToHtml() << 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; + if (wtap_block_get_string_option_value(shb_inf, OPT_SHB_OS, &str) == WTAP_OPTTYPE_SUCCESS) { + if (str != NULL && str[0] != '\0') { + capture_os = str; + } } out << table_row_begin << table_vheader_tmpl.arg(tr("OS")) @@ -268,9 +270,10 @@ QString CaptureFilePropertiesDialog::summaryToHtml() << 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; + if (wtap_block_get_string_option_value(shb_inf, OPT_SHB_USERAPPL, &str) == WTAP_OPTTYPE_SUCCESS) { + if (str != NULL && str[0] != '\0') { + capture_app = str; + } } out << table_row_begin << table_vheader_tmpl.arg(tr("Application")) diff --git a/ui/qt/resolved_addresses_dialog.cpp b/ui/qt/resolved_addresses_dialog.cpp index 791f6d1ca7..2e8b45cd0b 100644 --- a/ui/qt/resolved_addresses_dialog.cpp +++ b/ui/qt/resolved_addresses_dialog.cpp @@ -197,7 +197,22 @@ ResolvedAddressesDialog::ResolvedAddressesDialog(QWidget *parent, CaptureFile *c wtap* wth = capture_file->capFile()->wth; if (wth) { // might return null - comment_ = wtap_get_nrb_comment(wth); + wtap_block_t nrb_hdr; + + /* + * XXX - support multiple NRBs. + */ + nrb_hdr = wtap_file_get_nrb(wth); + if (nrb_hdr != NULL) { + char *str; + + /* + * XXX - support multiple comments. + */ + if (wtap_block_get_nth_string_option_value(nrb_hdr, OPT_COMMENT, 0, &str) == WTAP_OPTTYPE_SUCCESS) { + comment_ = str; + } + } } } |