aboutsummaryrefslogtreecommitdiffstats
path: root/epan/column-utils.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-03-08 15:17:58 -0800
committerRoland Knall <rknall@gmail.com>2018-03-15 12:19:23 +0000
commitbbe5fc102821cc3fa9e661078311f681501025ef (patch)
treeb61de63e63e01e4b55d59dd7ba4d46db6b484bb4 /epan/column-utils.c
parent03af5553eb1aaf38b2053e8b83a2be60097306d8 (diff)
Epan+Qt: Invalidate cached column strings.
Add col_data_changed, which checks to see if we have updated column info. Add col_append_frame_number, which adds a frame number and sets col_data_changed. Call col_append_frame_number instead of col_append_fstr from some dissectors. Add PacketListRecord::invalidateAllRecords, which invalidates any cached record data. Add PacketListModel::invalidateAllColumnStrings which calls invalidateAllRecords and signals that our data has changed. Call invalidateAllColumnStrings when we have new name resolution or column information. Bug: 11414 Bug: 11468 Change-Id: I2671594a722f4f9436fe1df84d43489a148e0cee Reviewed-on: https://code.wireshark.org/review/26373 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'epan/column-utils.c')
-rw-r--r--epan/column-utils.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c
index 42a9d8541f..9976804819 100644
--- a/epan/column-utils.c
+++ b/epan/column-utils.c
@@ -41,6 +41,9 @@
/* Used for locale decimal point */
static char *col_decimal_point;
+/* Used to indicate updated column information, e.g. a new request/response. */
+static gboolean col_data_changed_;
+
/* Allocate all the data structures for constructing column data, given
the number of columns. */
void
@@ -456,6 +459,15 @@ col_append_ports(column_info *cinfo, const gint col, port_type typ, guint16 src,
col_append_lstr(cinfo, col, buf_src, " " UTF8_RIGHTWARDS_ARROW " ", buf_dst, COL_ADD_LSTR_TERMINATOR);
}
+void
+col_append_frame_number(packet_info *pinfo, const gint col, const gchar *fmt_str, guint frame_num)
+{
+ col_append_fstr(pinfo->cinfo, col, fmt_str, frame_num);
+ if (!pinfo->fd->flags.visited) {
+ col_data_changed_ = TRUE;
+ }
+}
+
static void
col_do_append_fstr(column_info *cinfo, const int el, const char *separator, const char *format, va_list ap)
{
@@ -2282,6 +2294,10 @@ col_fill_in_error(column_info *cinfo, frame_data *fdata, const gboolean fill_col
}
}
+gboolean col_data_changed(void) {
+ return col_data_changed_;
+ col_data_changed_ = FALSE;
+}
/*
* Editor modelines
*