aboutsummaryrefslogtreecommitdiff
path: root/launcher/net/Download.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-06-28 13:21:00 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-06-28 13:21:00 +0300
commitc04cee7ff75730df2c859ecae4567abb4e98dcd4 (patch)
treea0e3025c131099576f79efd6dfb79caf7b926975 /launcher/net/Download.cpp
parent2680dba0aa74abefea58903dadad6578381101cb (diff)
parentfaec21d572549793293bf41127e384811f8a66dc (diff)
downloadPrismLauncher-c04cee7ff75730df2c859ecae4567abb4e98dcd4.tar.gz
PrismLauncher-c04cee7ff75730df2c859ecae4567abb4e98dcd4.tar.bz2
PrismLauncher-c04cee7ff75730df2c859ecae4567abb4e98dcd4.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into feat/acknowledge_release_type
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/net/Download.cpp')
-rw-r--r--launcher/net/Download.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/launcher/net/Download.cpp b/launcher/net/Download.cpp
index cd3fcc85..4ea45c63 100644
--- a/launcher/net/Download.cpp
+++ b/launcher/net/Download.cpp
@@ -41,6 +41,7 @@
#include <QDateTime>
#include <QFileInfo>
+#include <memory>
#include "ByteArraySink.h"
#include "ChecksumValidator.h"
@@ -69,7 +70,7 @@ auto Download::makeCached(QUrl url, MetaEntryPtr entry, Options options) -> Down
return dl;
}
-auto Download::makeByteArray(QUrl url, QByteArray* output, Options options) -> Download::Ptr
+auto Download::makeByteArray(QUrl url, std::shared_ptr<QByteArray> output, Options options) -> Download::Ptr
{
auto dl = makeShared<Download>();
dl->m_url = url;
@@ -134,11 +135,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);