Fixed the tooltip for unknown custom column field.

Apply the correction fix for the old packet list.

svn path=/trunk/; revision=31489
This commit is contained in:
Stig Bjørlykke 2010-01-11 08:16:14 +00:00
parent dd9d463bcf
commit 5c771d6e5f
2 changed files with 10 additions and 6 deletions

View File

@ -839,11 +839,16 @@ packet_list_set_column_titles(void)
GTK_SHRINK, GTK_SHRINK, 0, 0);
if (cfile.cinfo.col_fmt[i] == COL_CUSTOM) {
hfi = proto_registrar_get_byname(cfile.cinfo.col_custom_field[i]);
if (hfi->parent != -1) {
/* Prefix with protocol name */
tooltip_text = g_strdup_printf("%s\n%s (%s)", proto_get_protocol_name(hfi->parent), hfi->name, hfi->abbrev);
/* Check if this is a valid custom_field */
if (hfi) {
if (hfi->parent != -1) {
/* Prefix with protocol name */
tooltip_text = g_strdup_printf("%s\n%s (%s)", proto_get_protocol_name(hfi->parent), hfi->name, hfi->abbrev);
} else {
tooltip_text = g_strdup_printf("%s (%s)", hfi->name, hfi->abbrev);
}
} else {
tooltip_text = g_strdup_printf("%s (%s)", hfi->name, hfi->abbrev);
tooltip_text = g_strdup_printf("Unknown Field: %s", cfile.cinfo.col_custom_field[i]);
}
} else {
tooltip_text = g_strdup(col_format_desc(cfile.cinfo.col_fmt[i]));

View File

@ -473,8 +473,7 @@ create_view_and_model(void)
tooltip_text = g_strdup_printf("%s (%s)", hfi->name, hfi->abbrev);
}
} else {
/* XXX - include custom_field value? e.g. "Unknown Custom (foo.bar)" */
tooltip_text = g_strdup_printf("Unknown Custom Column Field");
tooltip_text = g_strdup_printf("Unknown Field: %s", cfile.cinfo.col_custom_field[i]);
}
} else {
tooltip_text = g_strdup(col_format_desc(cfile.cinfo.col_fmt[i]));