summaryrefslogtreecommitdiff
path: root/gtk/new_packet_list.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-04-24 21:02:55 +0000
committerGuy Harris <guy@alum.mit.edu>2011-04-24 21:02:55 +0000
commita39c3fab30321ab0cc888069cdb9aea70a45ebce (patch)
tree1276b9678568af7129259d74bd3df0d7278e4710 /gtk/new_packet_list.c
parentb99f04d32cfe34e5ff1d7f52518f36ae336e39a5 (diff)
downloadwireshark-a39c3fab30321ab0cc888069cdb9aea70a45ebce.tar.gz
new_packet_list_find_row_from_data() is always used to select a packet,
so get rid of the select_flag argument, and rename it new_packet_list_select_row_from_data(). It's also always passed a frame_data *, so make its argument a frame_data *. Its return value is used only to detect whether the packet was found in the display or not, so make it a gboolean. Check it in *all* cases where it's called, and change the dialog message a bit (the most likely cause is that the user cancelled a redissection of the packets, so not all packets in the capture file are in the display. Also, in the find case, pass it the new packet we found. svn path=/trunk/; revision=36839
Diffstat (limited to 'gtk/new_packet_list.c')
-rw-r--r--gtk/new_packet_list.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gtk/new_packet_list.c b/gtk/new_packet_list.c
index c54c83ace2..630485fe29 100644
--- a/gtk/new_packet_list.c
+++ b/gtk/new_packet_list.c
@@ -1134,18 +1134,22 @@ new_packet_list_check_end(void)
return at_end;
}
-gint
-new_packet_list_find_row_from_data(gpointer data, gboolean select_flag)
+/*
+ * Given a frame_data structure, scroll to and select the row in the
+ * packet list corresponding to that frame. If there is no such
+ * row, return FALSE, otherwise return TRUE.
+ */
+gboolean
+new_packet_list_select_row_from_data(frame_data *fdata_needle)
{
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(packetlist->view));
GtkTreeIter iter;
- frame_data *fdata_needle = data;
/* Initializes iter with the first iterator in the tree (the one at the path "0")
* and returns TRUE. Returns FALSE if the tree is empty
*/
if(!gtk_tree_model_get_iter_first(model, &iter))
- return -1;
+ return FALSE;
do {
PacketListRecord *record;
@@ -1155,14 +1159,13 @@ new_packet_list_find_row_from_data(gpointer data, gboolean select_flag)
fdata = record->fdata;
if(fdata == fdata_needle) {
- if(select_flag)
- scroll_to_and_select_iter(model, NULL, &iter);
+ scroll_to_and_select_iter(model, NULL, &iter);
- return fdata->num;
+ return TRUE;
}
} while (gtk_tree_model_iter_next(model, &iter));
- return -1;
+ return FALSE;
}
void