summaryrefslogtreecommitdiff
path: root/ui/packet_list_utils.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-08-27 11:53:29 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2016-08-27 11:15:34 +0000
commit5fe3e6af39fc55650ff9563906d016aa7becbaf1 (patch)
tree21a33031af073de364a96df9a9783dae6024d7ce /ui/packet_list_utils.c
parent124fb8307998151fb910df421aefcde35d8d4a1a (diff)
downloadwireshark-5fe3e6af39fc55650ff9563906d016aa7becbaf1.tar.gz
Qt: Support "Resolve Names" with multiple custom column fields
Make "Resolve Names" enabled if at least one of the custom column fields can be resolved. Change-Id: I702471be5d90c91f71209923e6abcc6921dca850 Reviewed-on: https://code.wireshark.org/review/17350 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui/packet_list_utils.c')
-rw-r--r--ui/packet_list_utils.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/ui/packet_list_utils.c b/ui/packet_list_utils.c
index de645cd9bd..931e5c7960 100644
--- a/ui/packet_list_utils.c
+++ b/ui/packet_list_utils.c
@@ -78,21 +78,26 @@ resolve_column (gint col, capture_file *cf)
{
header_field_info *hfi;
gboolean resolve = FALSE;
+ guint num_fields, *field_idx, ii;
if (!cf) return FALSE;
switch (cf->cinfo.columns[col].col_fmt) {
case COL_CUSTOM:
- hfi = proto_registrar_get_byname(cf->cinfo.columns[col].col_custom_fields);
- /* Check if this is a valid field */
- if (hfi != NULL) {
+ num_fields = g_slist_length(cf->cinfo.columns[col].col_custom_fields_ids);
+ for (ii = 0; ii < num_fields; ii++) {
+ field_idx = (guint *) g_slist_nth_data(cf->cinfo.columns[col].col_custom_fields_ids, ii);
+ hfi = proto_registrar_get_nth(*field_idx);
+
/* Check if we have an OID or a strings table with integer values */
if ((hfi->type == FT_OID) || (hfi->type == FT_REL_OID) ||
- ((hfi->strings != NULL) &&
- ((hfi->type == FT_BOOLEAN) || (hfi->type == FT_FRAMENUM) ||
- IS_FT_INT(hfi->type) || IS_FT_UINT(hfi->type)))) {
+ ((hfi->strings != NULL) &&
+ ((hfi->type == FT_BOOLEAN) || (hfi->type == FT_FRAMENUM) ||
+ IS_FT_INT(hfi->type) || IS_FT_UINT(hfi->type))))
+ {
resolve = TRUE;
+ break;
}
}
break;