Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2021-11-17 11:40:08 +0300
committerRobert Adam <dev@robert-adam.de>2022-03-22 20:28:26 +0300
commitbe41c0b921bc88bcf745c23967d37b154d46ca8a (patch)
tree72578e4491ad013d270fa3d6855f85a7af67c1d0 /src
parentb681d4d033ddc3b9219730c18074b3c811894fe3 (diff)
CHANGE(client): Display lost packages instead of received ones
In the server browser, the tooltip for the different entries shows the packet loss. It is displayed as a percentage and as a x/y stat. The latter currently displays <received>/<sent> which is very confusing, given that the title for that row is "Packet loss" implying x would describe the lost packages instead of the received ones. Thus this commit changes this to the expected behavior. Furthermore it makes sure that <lost> is always <= <sent>.
Diffstat (limited to 'src')
-rw-r--r--src/mumble/ConnectDialog.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mumble/ConnectDialog.cpp b/src/mumble/ConnectDialog.cpp
index c45ac6c5e..d3e6517d3 100644
--- a/src/mumble/ConnectDialog.cpp
+++ b/src/mumble/ConnectDialog.cpp
@@ -506,8 +506,10 @@ QVariant ServerItem::data(int column, int role) const {
if (uiSent > 0) {
qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>")
- .arg(ConnectDialog::tr("Packet loss"),
- QString::fromLatin1("%1% (%2/%3)").arg(ploss, 0, 'f', 1).arg(uiRecv).arg(uiSent));
+ .arg(ConnectDialog::tr("Packet loss"), QString::fromLatin1("%1% (%2/%3)")
+ .arg(ploss, 0, 'f', 1)
+ .arg(uiSent - std::min(uiRecv, uiSent))
+ .arg(uiSent));
if (uiRecv > 0) {
qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>")
.arg(ConnectDialog::tr("Ping (80%)"),