refactor: use Net tasks for github api download
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
@ -131,13 +131,12 @@ void Download::executeTask()
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined (LAUNCHER_APPLICATION)
|
||||
auto user_agent = APPLICATION->getUserAgent();
|
||||
#if defined(LAUNCHER_APPLICATION)
|
||||
auto user_agent = APPLICATION->getUserAgent().toUtf8();
|
||||
#else
|
||||
auto user_agent = BuildConfig.USER_AGENT;
|
||||
auto user_agent = BuildConfig.USER_AGENT.toUtf8();
|
||||
#endif
|
||||
|
||||
request.setHeader(QNetworkRequest::UserAgentHeader, user_agent.toUtf8());
|
||||
request.setHeader(QNetworkRequest::UserAgentHeader, user_agent);
|
||||
for ( auto& header_proxy : m_headerProxies ) {
|
||||
|
||||
header_proxy->writeHeaders(request);
|
||||
|
@ -59,6 +59,7 @@ class Download : public NetAction {
|
||||
public:
|
||||
~Download() override = default;
|
||||
|
||||
#if defined(LAUNCHER_APPLICATION)
|
||||
static auto makeCached(QUrl url, MetaEntryPtr entry, Options options = Option::NoOptions) -> Download::Ptr;
|
||||
static auto makeByteArray(QUrl url, std::shared_ptr<QByteArray> output, Options options = Option::NoOptions) -> Download::Ptr;
|
||||
static auto makeFile(QUrl url, QString path, Options options = Option::NoOptions) -> Download::Ptr;
|
||||
|
Reference in New Issue
Block a user