aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-12-12 23:34:03 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2017-12-13 10:35:36 +0000
commitf945b85391976bc59da4b542fe84cb58033bd22e (patch)
treed0a383c48b858f25da925d46fc85f6ed4d1f1d4f
parente4750105b23c2e19cfa4fbb79679b4a045ec0ebe (diff)
epan: Use expert info summary text as field name
Change the expert info registry to use summary text as field name instead of blurb to show the correct column header tooltip in custom columns. Preserve backward compability by not use empty summary text. Change-Id: Ibbaf142165be0d9f42d1e2476f39f8d251ea0593 Reviewed-on: https://code.wireshark.org/review/24788 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
-rw-r--r--epan/expert.c4
-rw-r--r--epan/wslua/wslua_proto.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/epan/expert.c b/epan/expert.c
index 4cf909c..aaea293 100644
--- a/epan/expert.c
+++ b/epan/expert.c
@@ -422,8 +422,10 @@ expert_register_field_array(expert_module_t *module, ei_register_info *exp, cons
/* Register with the header field info, so it's display filterable */
ptr->eiinfo.hf_info.p_id = &ptr->ids->hf;
+ if (ptr->eiinfo.summary && ptr->eiinfo.summary[0]) {
+ ptr->eiinfo.hf_info.hfinfo.name = ptr->eiinfo.summary;
+ }
ptr->eiinfo.hf_info.hfinfo.abbrev = ptr->eiinfo.name;
- ptr->eiinfo.hf_info.hfinfo.blurb = ptr->eiinfo.summary;
proto_register_field_array(module->proto_id, &ptr->eiinfo.hf_info, 1);
}
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c
index b8e2cc4..b92e855 100644
--- a/epan/wslua/wslua_proto.c
+++ b/epan/wslua/wslua_proto.c
@@ -755,8 +755,10 @@ int Proto_commit(lua_State* L) {
eiri.eiinfo.severity = e->severity;
eiri.eiinfo.summary = e->text;
- /* Copy this because it will be free'd when deregistering fields */
- eiri.eiinfo.hf_info.hfinfo.name = g_strdup(eiri.eiinfo.hf_info.hfinfo.name);
+ if (!eiri.eiinfo.summary || !eiri.eiinfo.summary[0]) {
+ /* Copy this because it will be free'd when deregistering fields */
+ eiri.eiinfo.hf_info.hfinfo.name = g_strdup(eiri.eiinfo.hf_info.hfinfo.name);
+ }
if (e->ids.ei != EI_INIT_EI || e->ids.hf != EI_INIT_HF) {
return luaL_error(L,"expert fields can be registered only once");