aboutsummaryrefslogtreecommitdiff
path: root/launcher/net/Download.cpp
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-05-21 01:48:34 -0700
committerRachel Powers <508861+Ryex@users.noreply.github.com>2023-05-21 01:48:34 -0700
commit79839771561641d6fa34549861a5ed163e382312 (patch)
tree3b0132349ab9b5d3108c5cb60991446eefdf768e /launcher/net/Download.cpp
parent21cb4598999808849eb18503f7aae54039c73cea (diff)
downloadPrismLauncher-79839771561641d6fa34549861a5ed163e382312.tar.gz
PrismLauncher-79839771561641d6fa34549861a5ed163e382312.tar.bz2
PrismLauncher-79839771561641d6fa34549861a5ed163e382312.zip
feat: Qt 5.15 adds transfer timeouts. at least use it for downloads
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/net/Download.cpp')
-rw-r--r--launcher/net/Download.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/launcher/net/Download.cpp b/launcher/net/Download.cpp
index cd3fcc85..7f8d3a06 100644
--- a/launcher/net/Download.cpp
+++ b/launcher/net/Download.cpp
@@ -134,11 +134,14 @@ void Download::executeTask()
request.setRawHeader("Authorization", token.toUtf8());
}
+#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
+ request.setTransferTimeout();
+#endif
+
m_last_progress_time = m_clock.now();
m_last_progress_bytes = 0;
QNetworkReply* rep = m_network->get(request);
-
m_reply.reset(rep);
connect(rep, &QNetworkReply::downloadProgress, this, &Download::downloadProgress);
connect(rep, &QNetworkReply::finished, this, &Download::downloadFinished);