aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/packet_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gtk/packet_list.c')
-rw-r--r--ui/gtk/packet_list.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/ui/gtk/packet_list.c b/ui/gtk/packet_list.c
index 06e8364c75..477a782c81 100644
--- a/ui/gtk/packet_list.c
+++ b/ui/gtk/packet_list.c
@@ -662,6 +662,7 @@ create_view_and_model(void)
header_field_info *hfi;
gint col_min_width;
gchar *escaped_title;
+ col_item_t* col_item;
packetlist = packet_list_new();
@@ -691,6 +692,7 @@ create_view_and_model(void)
/* We need one extra column to store the entire PacketListRecord */
for(i = 0; i < cfile.cinfo.num_cols; i++) {
+ col_item = &cfile.cinfo.columns[i];
renderer = gtk_cell_renderer_text_new();
col = gtk_tree_view_column_new();
gtk_tree_view_column_pack_start(col, renderer, TRUE);
@@ -706,14 +708,14 @@ create_view_and_model(void)
show_cell_data_func,
GINT_TO_POINTER(i),
NULL);
- if (cfile.cinfo.col_fmt[i] == COL_CUSTOM) {
- hfi = proto_registrar_get_byname(cfile.cinfo.col_custom_field[i]);
+ if (col_item->col_fmt == COL_CUSTOM) {
+ hfi = proto_registrar_get_byname(col_item->col_custom_field);
/* Check if this is a valid custom_field */
if (hfi != NULL) {
if (hfi->parent != -1) {
/* Prefix with protocol name */
- if (cfile.cinfo.col_custom_occurrence[i] != 0) {
- tooltip_text = g_strdup_printf("%s\n%s (%s#%d)", proto_get_protocol_name(hfi->parent), hfi->name, hfi->abbrev, cfile.cinfo.col_custom_occurrence[i]);
+ if (col_item->col_custom_occurrence != 0) {
+ tooltip_text = g_strdup_printf("%s\n%s (%s#%d)", proto_get_protocol_name(hfi->parent), hfi->name, hfi->abbrev, col_item->col_custom_occurrence);
} else {
tooltip_text = g_strdup_printf("%s\n%s (%s)", proto_get_protocol_name(hfi->parent), hfi->name, hfi->abbrev);
}
@@ -724,9 +726,9 @@ create_view_and_model(void)
tooltip_text = g_strdup_printf("Unknown Field: %s", get_column_custom_field(i));
}
} else {
- tooltip_text = g_strdup(col_format_desc(cfile.cinfo.col_fmt[i]));
+ tooltip_text = g_strdup(col_format_desc(col_item->col_fmt));
}
- escaped_title = ws_strdup_escape_char(cfile.cinfo.col_title[i], '_');
+ escaped_title = ws_strdup_escape_char(col_item->col_title, '_');
gtk_tree_view_column_set_title(col, escaped_title);
g_free (escaped_title);
gtk_tree_view_column_set_clickable(col, TRUE);
@@ -743,7 +745,7 @@ create_view_and_model(void)
* XXX The minimum size will be the size of the title
* should that be limited for long titles?
*/
- col_min_width = get_default_col_size (packetlist->view, cfile.cinfo.col_title[i]);
+ col_min_width = get_default_col_size (packetlist->view, cfile.cinfo.columns[i].col_title);
if(col_min_width<COLUMN_WIDTH_MIN){
gtk_tree_view_column_set_min_width(col, COLUMN_WIDTH_MIN);
}else{