aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2016-07-05 16:45:52 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2016-07-06 06:48:41 +0000
commit4b062227c7e0c41dc76780da9c7e5612733ef911 (patch)
tree8be8b38b532b05ad79084d74eebad89e67370c67
parent50d1d59213886de1f348d85175dbdbe82fe1c87c (diff)
Qt: add initializers (CID 1268205).
Change-Id: I7eb71876731df29c076a3a756b6748f165d1c327 Reviewed-on: https://code.wireshark.org/review/16306 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r--ui/qt/protocol_hierarchy_dialog.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/ui/qt/protocol_hierarchy_dialog.cpp b/ui/qt/protocol_hierarchy_dialog.cpp
index 51bda42978..aa9684ff14 100644
--- a/ui/qt/protocol_hierarchy_dialog.cpp
+++ b/ui/qt/protocol_hierarchy_dialog.cpp
@@ -61,18 +61,18 @@ Q_DECLARE_METATYPE(ph_stats_t*)
class ProtocolHierarchyTreeWidgetItem : public QTreeWidgetItem
{
public:
- ProtocolHierarchyTreeWidgetItem(QTreeWidgetItem *parent, ph_stats_node_t *ph_stats_node) :
+ ProtocolHierarchyTreeWidgetItem(QTreeWidgetItem *parent, ph_stats_node_t& ph_stats_node) :
QTreeWidgetItem(parent),
+ total_packets_(ph_stats_node.num_pkts_total),
+ last_packets_(ph_stats_node.num_pkts_last),
+ total_bytes_(ph_stats_node.num_bytes_total),
+ last_bytes_(ph_stats_node.num_bytes_last),
+ percent_packets_(0),
+ percent_bytes_(0),
bits_s_(0.0),
end_bits_s_(0.0)
{
- if (!ph_stats_node) return;
-
- filter_name_ = ph_stats_node->hfinfo->abbrev;
- total_packets_ = ph_stats_node->num_pkts_total;
- last_packets_ = ph_stats_node->num_pkts_last;
- total_bytes_ = ph_stats_node->num_bytes_total;
- last_bytes_ = ph_stats_node->num_bytes_last;
+ filter_name_ = ph_stats_node.hfinfo->abbrev;
if (!parent) return;
ph_stats_t *ph_stats = parent->treeWidget()->invisibleRootItem()->data(0, Qt::UserRole).value<ph_stats_t*>();
@@ -88,7 +88,7 @@ public:
end_bits_s_ = last_bytes_ * 8.0 / seconds;
}
- setText(protocol_col_, ph_stats_node->hfinfo->name);
+ setText(protocol_col_, ph_stats_node.hfinfo->name);
setData(pct_packets_col_, Qt::UserRole, percent_packets_);
setText(packets_col_, QString::number(total_packets_));
setData(pct_bytes_col_, Qt::UserRole, percent_bytes_);
@@ -287,7 +287,7 @@ void ProtocolHierarchyDialog::addTreeNode(GNode *node, gpointer data)
QTreeWidgetItem *parent_ti = static_cast<QTreeWidgetItem *>(data);
if (!parent_ti) return;
- ProtocolHierarchyTreeWidgetItem *phti = new ProtocolHierarchyTreeWidgetItem(parent_ti, stats);
+ ProtocolHierarchyTreeWidgetItem *phti = new ProtocolHierarchyTreeWidgetItem(parent_ti, *stats);
g_node_children_foreach(node, G_TRAVERSE_ALL, addTreeNode, phti);