aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/capture_file_properties_dialog.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-01-03 08:49:57 -0800
committerRoland Knall <rknall@gmail.com>2018-01-04 11:57:50 +0000
commit1e05c57cca59c0469e19b74ec6a47a1669059d41 (patch)
tree3d6cafaad5df08cb1389321fd7883ded7c68db3b /ui/qt/capture_file_properties_dialog.cpp
parent51d83583c1b6fcaafa8c31e76568b861d1144787 (diff)
Qt: Fix capture file properties averages.
Round our average packet sizes to the nearest whole number as described in bug 9836 and change 687. Change-Id: I842eca7650d19be66eb35c40a886bd591a86650d Reviewed-on: https://code.wireshark.org/review/25129 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 'ui/qt/capture_file_properties_dialog.cpp')
-rw-r--r--ui/qt/capture_file_properties_dialog.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp
index 70d76e568c..ff3aed3cfa 100644
--- a/ui/qt/capture_file_properties_dialog.cpp
+++ b/ui/qt/capture_file_properties_dialog.cpp
@@ -417,16 +417,16 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
<< table_data_tmpl.arg(marked_str)
<< table_row_end;
- // Average packets per second
+ // Average packet size
captured_str = displayed_str = marked_str = n_a;
if (summary.packet_count > 0) {
- captured_str = QString("%1").arg(summary.bytes/summary.packet_count + 0.5, 1, 'f', 1);
+ captured_str = QString::number((guint64) ((double)summary.bytes/summary.packet_count + 0.5));
}
if (summary.filtered_count > 0) {
- displayed_str = QString("%1").arg(summary.filtered_bytes/summary.filtered_count + 0.5, 1, 'f', 1);
+ displayed_str = QString::number((guint64) ((double)summary.filtered_bytes/summary.filtered_count + 0.5));
}
if (summary.marked_count > 0) {
- marked_str = QString("%1").arg(summary.marked_bytes/summary.marked_count + 0.5, 1, 'f', 1);
+ marked_str = QString::number((guint64) ((double)summary.marked_bytes/summary.marked_count + 0.5));
}
out << table_row_begin
<< table_data_tmpl.arg(tr("Average packet size, B"))