url must be decode before sending the get request

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 9f2e033d22
commit c7c89a981d
  1. 5
      src/core/UBDownloadManager.cpp
  2. 20
      src/network/UBHttpGet.cpp

@ -306,8 +306,11 @@ void UBDownloadManager::startFileDownload(sDownloadFileDesc desc)
connect(http, SIGNAL(downloadProgress(int, qint64,qint64)), this, SLOT(onDownloadProgress(int,qint64,qint64)));
connect(http, SIGNAL(downloadFinished(int, bool, QUrl, QString, QByteArray, QPointF, QSize, bool)), this, SLOT(onDownloadFinished(int, bool, QUrl, QString, QByteArray, QPointF, QSize, bool)));
//the desc.url is encoded. So we have to decode it before.
QUrl url;
url.setEncodedUrl(desc.url.toUtf8());
// We send here the request and store its reply in order to be able to cancel it if needed
mReplies[desc.id] = http->get(QUrl(desc.url), desc.pos, desc.size, desc.isBackground);
mReplies[desc.id] = http->get(url, desc.pos, desc.size, desc.isBackground);
}
/**

@ -65,26 +65,6 @@ QNetworkReply* UBHttpGet::get(QUrl pUrl, QPointF pPos, QSize pSize, bool isBackg
return mReply;
}
//QNetworkReply* UBHttpGet::get(const sDownloadFileDesc &downlinfo)
//{
// mDownloadInfo.size = downlinfo.size;
// mDownloadInfo.isBackground = downlinfo.isBackground;
// mDownloadInfo.pos = downlinfo.pos;
// if (mReply)
// delete mReply;
// UBNetworkAccessManager * nam = UBNetworkAccessManager::defaultAccessManager();
// mReply = nam->get(QNetworkRequest(QUrl(downlinfo.url))); //mReply deleted by this destructor
// mDownloadedBytes.clear();
// connect(mReply, SIGNAL(finished()), this, SLOT(requestFinished()));
// connect(mReply, SIGNAL(readyRead()), this, SLOT(readyRead()));
// connect(mReply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgressed(qint64, qint64)));
// return mReply;
//}
void UBHttpGet::readyRead()
{

Loading…
Cancel
Save