|
|
@ -34,7 +34,6 @@ |
|
|
|
#include <QNetworkAccessManager> |
|
|
|
#include <QNetworkAccessManager> |
|
|
|
#include <QNetworkCookie> |
|
|
|
#include <QNetworkCookie> |
|
|
|
#include <QNetworkProxy> |
|
|
|
#include <QNetworkProxy> |
|
|
|
#include <QNetworkReply> |
|
|
|
|
|
|
|
#include <QNetworkRequest> |
|
|
|
#include <QNetworkRequest> |
|
|
|
#include <QTemporaryFile> |
|
|
|
#include <QTemporaryFile> |
|
|
|
#include <QUrl> |
|
|
|
#include <QUrl> |
|
|
@ -46,9 +45,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
namespace |
|
|
|
namespace |
|
|
|
{ |
|
|
|
{ |
|
|
|
QString tr(const char *message); |
|
|
|
|
|
|
|
QString errorCodeToString(QNetworkReply::NetworkError status); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool saveToFile(const QByteArray &replyData, QString &filePath) |
|
|
|
bool saveToFile(const QByteArray &replyData, QString &filePath) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QTemporaryFile tmpfile {Utils::Fs::tempPath() + "XXXXXX"}; |
|
|
|
QTemporaryFile tmpfile {Utils::Fs::tempPath() + "XXXXXX"}; |
|
|
@ -203,14 +199,7 @@ void Net::DownloadHandler::handleRedirection(QUrl newUrl) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
namespace |
|
|
|
QString Net::DownloadHandler::errorCodeToString(const QNetworkReply::NetworkError status) |
|
|
|
{ |
|
|
|
|
|
|
|
QString tr(const char *message) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return QCoreApplication::translate("DownloadHandler", message); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString errorCodeToString(QNetworkReply::NetworkError status) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (status) { |
|
|
|
switch (status) { |
|
|
|
case QNetworkReply::HostNotFoundError: |
|
|
|
case QNetworkReply::HostNotFoundError: |
|
|
@ -259,4 +248,3 @@ namespace |
|
|
|
return tr("Unknown error"); |
|
|
|
return tr("Unknown error"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|