Skip to content

Commit

Permalink
Merge pull request #255 from schlamar/patch-1
Browse files Browse the repository at this point in the history
Set User-Agent for HTTP downloads
  • Loading branch information
trollixx committed Jan 13, 2015
2 parents 68591d7 + 1594624 commit 2927d45
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,13 @@ void SettingsDialog::resetProgress()

QNetworkReply *SettingsDialog::startDownload(const QUrl &url, qint8 retries)
{
QString USER_AGENT = QStringLiteral("Zeal " ZEAL_VERSION);
startTasks(1);
m_networkManager->setProxy(httpProxy());
QNetworkReply *reply = m_networkManager->get(QNetworkRequest(url));
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::UserAgentHeader, USER_AGENT);

QNetworkReply *reply = m_networkManager->get(request);
connect(reply, &QNetworkReply::downloadProgress, this, &SettingsDialog::on_downloadProgress);
replies.insert(reply, retries);

Expand Down

0 comments on commit 2927d45

Please sign in to comment.