diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-07-16 20:49:01 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-07-17 03:49:45 +0000 |
commit | 9a7bc3ef09b5589ece51fa8f281c2855079852ee (patch) | |
tree | 65ae691843fb54e17eed7e27e55b5c0638f9e7f8 | |
parent | c8f45f5be221983745eaa05f10ecdd35f006c2bd (diff) | |
download | wireshark-9a7bc3ef09b5589ece51fa8f281c2855079852ee.tar.gz wireshark-9a7bc3ef09b5589ece51fa8f281c2855079852ee.tar.bz2 wireshark-9a7bc3ef09b5589ece51fa8f281c2855079852ee.zip |
Rename cf_get_comment() to reflect what comment it gets.
Change-Id: Id3b0430a1d462b29833259462536ed4cb0424f77
Reviewed-on: https://code.wireshark.org/review/22662
Reviewed-by: Guy Harris <guy@alum.mit.edu>
(cherry picked from commit 4dd48721ee633fd2db3534ad2e43c00847dce42f)
Reviewed-on: https://code.wireshark.org/review/22663
-rw-r--r-- | file.c | 12 | ||||
-rw-r--r-- | file.h | 10 | ||||
-rw-r--r-- | ui/gtk/packet_list.c | 6 | ||||
-rw-r--r-- | ui/qt/capture_file_properties_dialog.cpp | 2 | ||||
-rw-r--r-- | ui/qt/packet_list.cpp | 4 |
5 files changed, 25 insertions, 9 deletions
@@ -3864,8 +3864,13 @@ cf_get_user_packet_comment(capture_file *cf, const frame_data *fd) return NULL; } +/* + * Get the comment on a packet (record). + * If the comment has been edited, it returns the result of the edit, + * otherwise it returns the comment from the file. + */ char * -cf_get_comment(capture_file *cf, const frame_data *fd) +cf_get_packet_comment(capture_file *cf, const frame_data *fd) { char *comment; @@ -3903,10 +3908,13 @@ frame_cmp(gconstpointer a, gconstpointer b, gpointer user_data _U_) 0; } +/* + * Update(replace) the comment on a capture from a frame + */ gboolean cf_set_user_packet_comment(capture_file *cf, frame_data *fd, const gchar *new_comment) { - char *pkt_comment = cf_get_comment(cf, fd); + char *pkt_comment = cf_get_packet_comment(cf, fd); /* Check if the comment has changed */ if (!g_strcmp0(pkt_comment, new_comment)) { @@ -693,7 +693,15 @@ const gchar* cf_read_section_comment(capture_file *cf); */ void cf_update_section_comment(capture_file *cf, gchar *comment); -char *cf_get_comment(capture_file *cf, const frame_data *fd); +/* + * Get the comment on a packet (record). + * If the comment has been edited, it returns the result of the edit, + * otherwise it returns the comment from the file. + * + * @param cf the capture file + * @param fd the frame_data structure for the frame + */ +char *cf_get_packet_comment(capture_file *cf, const frame_data *fd); /** * Update(replace) the comment on a capture from a frame diff --git a/ui/gtk/packet_list.c b/ui/gtk/packet_list.c index 5adfbb7702..fca31ca2fe 100644 --- a/ui/gtk/packet_list.c +++ b/ui/gtk/packet_list.c @@ -1557,7 +1557,7 @@ packet_list_get_packet_comment(void) fdata = packet_list_get_record(model, &iter); - return cf_get_comment(&cfile, fdata); + return cf_get_packet_comment(&cfile, fdata); } void @@ -1571,7 +1571,7 @@ packet_list_return_all_comments(GtkTextBuffer *buffer) char *pkt_comment; fdata = frame_data_sequence_find(cfile.frames, framenum); - pkt_comment = cf_get_comment(&cfile, fdata); + pkt_comment = cf_get_packet_comment(&cfile, fdata); if (pkt_comment) { buf_str = g_strdup_printf("Frame %u: %s \n\n",framenum, pkt_comment); gtk_text_buffer_insert_at_cursor (buffer, buf_str, -1); @@ -1697,7 +1697,7 @@ query_packet_list_tooltip_cb(GtkWidget *widget, gint x, gint y, gboolean keyboar } fdata = packet_list_get_record(model, &iter); - pkt_comment = cf_get_comment(&cfile, fdata); + pkt_comment = cf_get_packet_comment(&cfile, fdata); if (pkt_comment != NULL) { gtk_tooltip_set_markup(tooltip, pkt_comment); diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp index a8e7284008..7d5ae82369 100644 --- a/ui/qt/capture_file_properties_dialog.cpp +++ b/ui/qt/capture_file_properties_dialog.cpp @@ -530,7 +530,7 @@ void CaptureFilePropertiesDialog::fillDetails() for (guint32 framenum = 1; framenum <= cap_file_.capFile()->count ; framenum++) { frame_data *fdata = frame_data_sequence_find(cap_file_.capFile()->frames, framenum); - char *pkt_comment = cf_get_comment(cap_file_.capFile(), fdata); + char *pkt_comment = cf_get_packet_comment(cap_file_.capFile(), fdata); if (pkt_comment) { QString frame_comment_html = tr("<p>Frame %1: ").arg(framenum); diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index e966d6deaf..0d6e1e3630 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -1091,7 +1091,7 @@ QString PacketList::packetComment() if (!fdata) return NULL; - pkt_comment = cf_get_comment(cap_file_, fdata); + pkt_comment = cf_get_packet_comment(cap_file_, fdata); return QString(pkt_comment); @@ -1134,7 +1134,7 @@ QString PacketList::allPacketComments() for (framenum = 1; framenum <= cap_file_->count ; framenum++) { fdata = frame_data_sequence_find(cap_file_->frames, framenum); - char *pkt_comment = cf_get_comment(cap_file_, fdata); + char *pkt_comment = cf_get_packet_comment(cap_file_, fdata); if (pkt_comment) { buf_str.append(QString(tr("Frame %1: %2\n\n")).arg(framenum).arg(pkt_comment)); |