aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/main_window.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-11-23 01:06:30 +0000
committerGerald Combs <gerald@wireshark.org>2013-11-23 01:06:30 +0000
commitb3a24c5cc401498535ffdb64aaa212e46e587698 (patch)
treedc835e50c3dc6745eea9f958a20e0af3f72ea228 /ui/qt/main_window.cpp
parent11d8147ab57af71f28b59f8a43f6a9a0618e0c66 (diff)
Replace similar code with a common routine.
svn path=/trunk/; revision=53519
Diffstat (limited to 'ui/qt/main_window.cpp')
-rw-r--r--ui/qt/main_window.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index cbd010aa8e..d3c827406d 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -1366,9 +1366,6 @@ void MainWindow::setTitlebarForCaptureInProgress()
void MainWindow::setMenusForFollowStream()
{
- wmem_list_frame_t* protos;
- int proto_id;
- const char* proto_name;
gboolean is_tcp = FALSE, is_udp = FALSE;
if (!cap_file_)
@@ -1381,24 +1378,8 @@ void MainWindow::setMenusForFollowStream()
main_ui_->actionAnalyzeFollowUDPStream->setEnabled(false);
main_ui_->actionAnalyzeFollowSSLStream->setEnabled(false);
- protos = wmem_list_head(cap_file_->edt->pi.layers);
-
- /* walk the list of a available protocols in the packet to
- figure out if any of them affect context sensitivity */
- while (protos != NULL)
- {
- proto_id = GPOINTER_TO_INT(wmem_list_frame_data(protos));
- proto_name = proto_get_protocol_filter_name(proto_id);
-
- if (!strcmp(proto_name, "tcp")) {
- is_tcp = TRUE;
- } else if (!strcmp(proto_name, "udp")) {
- is_udp = TRUE;
- }
-
- protos = wmem_list_frame_next(protos);
- }
-
+ proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL);
+
if (is_tcp)
{
main_ui_->actionAnalyzeFollowTCPStream->setEnabled(true);