void PacketList::contextMenuEvent(QContextMenuEvent *event) { const char *module_name = NULL; if (cap_file_ && cap_file_->edt && cap_file_->edt->tree) { GPtrArray *finfo_array = proto_all_finfos(cap_file_->edt->tree); for (guint i = finfo_array->len - 1; i > 0 ; i --) { field_info *fi = (field_info *)g_ptr_array_index (finfo_array, i); header_field_info *hfinfo = fi->hfinfo; if (!g_str_has_prefix(hfinfo->abbrev, "text") && !g_str_has_prefix(hfinfo->abbrev, "_ws.expert") && !g_str_has_prefix(hfinfo->abbrev, "_ws.malformed")) { if (hfinfo->parent == -1) { module_name = hfinfo->abbrev; } else { module_name = proto_registrar_get_abbrev(hfinfo->parent); } break; } } } proto_prefs_menu_.setModule(module_name); foreach (QAction *action, copy_actions_) { action->setData(QVariant()); }
static const gchar* my_protoname(int proto_id) { if (proto_id) { return proto_registrar_get_abbrev(proto_id); } else { return "*"; } }
const QString FieldInformation::moduleName() { QString module_name; if (isValid()) { if (headerInfo().parent == -1) { module_name = fi_->hfinfo->abbrev; } else { module_name = proto_registrar_get_abbrev(headerInfo().parent); } } return module_name; }