Column index now corresponds to the column in the tree view.
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 12 Jul 2009 19:38:55 +0000 (19:38 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 12 Jul 2009 19:38:55 +0000 (19:38 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29075 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/new_packet_list.c
gtk/packet_list_store.c

index 73f7209bfa5887f73348a0b6d51a0b8f267530c3..2b2c25baaad34c10ddc3706acc3c68570a00b061 100644 (file)
@@ -132,8 +132,7 @@ create_view_and_model(void)
        for(i = 0; i < cfile.cinfo.num_cols; i++) {
                col = gtk_tree_view_column_new();
                gtk_tree_view_column_pack_start(col, renderer, TRUE);
-               gtk_tree_view_column_add_attribute(col, renderer, "text",
-                                                  cfile.cinfo.col_fmt[i]);
+               gtk_tree_view_column_add_attribute(col, renderer, "text",i);
                gtk_tree_view_column_set_title(col, cfile.cinfo.col_title[i]);
                gtk_tree_view_column_set_sort_column_id(col, i);
                gtk_tree_view_column_set_resizable(col, TRUE);
index 1b1cc14344ab1b6f17ea4aaf5b116f7449ccc28a..07a4d09cbdf7373a51f0f0858930df28d9b744dd 100644 (file)
 #include <gtk/gtk.h>
 #include <glib.h>
 
-#if 0
 #include "epan/column_info.h"
 #include "epan/column.h"
-#endif
 
 #include "packet_list_store.h"
 #include "globals.h"
@@ -206,7 +204,6 @@ static void
 packet_list_init(PacketList *packet_list)
 {
        guint i;
-#if 0
        gint fmt;
 
        for(i = 0; i < (guint)cfile.cinfo.num_cols; i++) {
@@ -222,14 +219,8 @@ packet_list_init(PacketList *packet_list)
                                break;
                }
        }
-#endif
-
-       for(i = 0; i < NUM_COL_FMTS; i++) { /* XXX - Temporary? */
-               packet_list->column_types[i] = G_TYPE_STRING;
-       }
        
-
-       packet_list->n_columns = NUM_COL_FMTS;
+       packet_list->n_columns = (guint)cfile.cinfo.num_cols;
        packet_list->num_rows = 0;
        packet_list->rows = NULL;
 
@@ -517,12 +508,12 @@ packet_list_append_record(PacketList *packet_list, row_data_t *row_data)
                                    packet_list->num_rows);
 
        newrecord = se_alloc0(sizeof(PacketListRecord));
-       newrecord->col_text = se_alloc0(sizeof(row_data->col_text)* NUM_COL_FMTS);
+       newrecord->col_text = se_alloc0(sizeof(row_data->col_text)* cfile.cinfo.num_cols);
 
 
        /* XXX newrecord->col_text still uses the fmt index */
        for(i = 0; i < cfile.cinfo.num_cols; i++)
-               newrecord->col_text[row_data->col_fmt[i]] = row_data->col_text[i];
+               newrecord->col_text[i] = row_data->col_text[i];
 
        newrecord->fdata = row_data->fdata;