Fix the debug code somewhat, we do not have a clist any more.
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 23 Sep 2009 13:54:43 +0000 (13:54 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 23 Sep 2009 13:54:43 +0000 (13:54 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30085 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/decode_as_dlg.c

index 255360c17d9b146a0b14bc454856e8e31c1b1387..f0affeeb48b24f8a1ff53d9fe6e95779150fcc9e 100644 (file)
@@ -675,22 +675,28 @@ decode_change_one_dissector(gchar *table_name, guint selector, GtkWidget *list)
  * @param leadin A string to print at the start of each line.
  */
 static void
-decode_debug (GtkCList *clist, gchar *leadin)
+decode_debug (GtkTreeView *tree_view, gchar *leadin)
 {
+       GtkListStore *store;
+       GtkTreeSelection *selection;
+       GtkTreeIter iter;
     gchar *string, *text[E_LIST_S_COLUMNS];
     dissector_handle_t handle;
-    gint row;
-
-    if (clist->selection) {
-       row = GPOINTER_TO_INT(clist->selection->data);
-       gtk_clist_get_text(clist, row, E_LIST_S_PROTO_NAME, &text[E_LIST_S_PROTO_NAME]);
-       gtk_clist_get_text(clist, row, E_LIST_S_TABLE, &text[E_LIST_S_TABLE]);
-       handle = gtk_clist_get_row_data(clist, row);
-       string = g_strdup_printf("%s clist row %d: <put handle here>, name %s, table %s",
-               leadin, row, text[E_LIST_S_PROTO_NAME],
-               text[E_LIST_S_TABLE]);
+
+       selection = gtk_tree_view_get_selection(tree_view);
+
+       if (gtk_tree_selection_get_selected(selection, NULL, &iter)){
+               store = GTK_LIST_STORE(gtk_tree_view_get_model(tree_view));
+               gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, 
+                       E_LIST_S_PROTO_NAME, &text[E_LIST_S_PROTO_NAME],
+                       E_LIST_S_TABLE, &text[E_LIST_S_TABLE],
+                       E_LIST_S_TABLE+1, &handle,
+                       -1);
+               string = g_strdup_printf("%s list: <put handle here>, name %s, table %s",
+                       leadin, text[E_LIST_S_PROTO_NAME],
+                       text[E_LIST_S_TABLE]);
     } else {
-       string = g_strdup_printf("%s clist row (none), aka do not decode", leadin);
+               string = g_strdup_printf("%s list row (none), aka do not decode", leadin);
     }
     simple_dialog(ESD_TYPE_INFO, ESD_BTN_OK, string);
     g_free(string);
@@ -724,7 +730,7 @@ decode_simple (GtkWidget *notebook_pg)
 
 #ifdef DEBUG
     string = g_object_get_data(G_OBJECT(notebook_pg), E_PAGE_TITLE);
-    decode_debug(GTK_CLIST(list), string);
+    decode_debug(GTK_TREE_VIEW(list), string);
 #endif
 
     table_name = g_object_get_data(G_OBJECT(notebook_pg), E_PAGE_TABLE);
@@ -749,6 +755,9 @@ decode_transport(GtkWidget *notebook_pg)
     gchar *table_name;
     gint requested_srcdst, requested_port, ppid;
     gpointer portp;
+#ifdef DEBUG
+       gchar *string;
+#endif
 
     list = g_object_get_data(G_OBJECT(notebook_pg), E_PAGE_LIST);
     if (requested_action == E_DECODE_NO)
@@ -761,7 +770,7 @@ decode_transport(GtkWidget *notebook_pg)
 
 #ifdef DEBUG
     string = g_object_get_data(G_OBJECT(notebook_pg), E_PAGE_TITLE);
-    decode_debug(GTK_CLIST(list), string);
+    decode_debug(GTK_TREE_VIEW(list), string);
 #endif
 
     table_name = g_object_get_data(G_OBJECT(notebook_pg), E_PAGE_TABLE);