aboutsummaryrefslogtreecommitdiff
path: root/launcher/net/Download.cpp
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-05-05 14:07:10 -0700
committerGitHub <noreply@github.com>2023-05-05 14:07:10 -0700
commitb266068644d2caab4f103b0adf7a491b95f52369 (patch)
tree8de677072a75350959e3db64d86105a951f231f4 /launcher/net/Download.cpp
parent733619ca741336ba9999af43f4eddd9371462325 (diff)
downloadPrismLauncher-b266068644d2caab4f103b0adf7a491b95f52369.tar.gz
PrismLauncher-b266068644d2caab4f103b0adf7a491b95f52369.tar.bz2
PrismLauncher-b266068644d2caab4f103b0adf7a491b95f52369.zip
Apply suggestions from code review
Co-authored-by: flow <flowlnlnln@gmail.com> Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/net/Download.cpp')
-rw-r--r--launcher/net/Download.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/launcher/net/Download.cpp b/launcher/net/Download.cpp
index bf0e5c26..082f963d 100644
--- a/launcher/net/Download.cpp
+++ b/launcher/net/Download.cpp
@@ -247,19 +247,20 @@ void Download::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
// use milliseconds for speed precision
auto elapsed_ms = std::chrono::duration_cast<std::chrono::milliseconds>(elapsed);
- auto bytes_recived_since = bytesReceived - m_last_progress_bytes;
- auto dl_speed_bps = (double)bytes_recived_since / elapsed_ms.count() * 1000;
+ auto bytes_received_since = bytesReceived - m_last_progress_bytes;
+ auto dl_speed_bps = (double)bytes_received_since / elapsed_ms.count() * 1000;
auto remaing_time_s = (bytesTotal - bytesReceived) / dl_speed_bps;
- // current bytes out of total bytes
+ //: Current amount of bytes downloaded, out of the total amount of bytes in the download
QString dl_progress = tr("%1 / %2").arg(humanReadableFileSize(bytesReceived)).arg(humanReadableFileSize(bytesTotal));
QString dl_speed_str;
if (elapsed_ms.count() > 0) {
- // bytes per second
- dl_speed_str = tr("%1/s (%2)").arg(humanReadableFileSize(dl_speed_bps)).arg(humanReadableDuration(remaing_time_s));
+ //: Download speed, in bytes per second (remaining download time in parenthesis)
+ dl_speed_str = tr("%1 /s (%2)").arg(humanReadableFileSize(dl_speed_bps)).arg(humanReadableDuration(remaing_time_s));
} else {
- dl_speed_str = tr("0 b/s");
+ //: Download speed at 0 bytes per second
+ dl_speed_str = tr("0 B/s");
}
setDetails(dl_progress + "\n" + dl_speed_str);