From be41c0b921bc88bcf745c23967d37b154d46ca8a Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Wed, 17 Nov 2021 09:40:08 +0100 Subject: [PATCH] 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 / 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 is always <= . --- src/mumble/ConnectDialog.cpp | 6 ++++-- 1 file 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("%1%2") - .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("%1%2") .arg(ConnectDialog::tr("Ping (80%)"),