mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-27 15:04:36 +00:00
Fix wrong warning in torrent addition dialog (closes #579301)
This commit is contained in:
parent
4ec1fd3968
commit
ea99f44893
@ -57,6 +57,7 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
|
||||
QString url = reply->url().toString();
|
||||
if(reply->error() != QNetworkReply::NoError) {
|
||||
// Failure
|
||||
qDebug("Download failure (%s), reason: %s", qPrintable(url), qPrintable(errorCodeToString(reply->error())));
|
||||
emit downloadFailure(url, errorCodeToString(reply->error()));
|
||||
} else {
|
||||
QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
|
||||
@ -80,7 +81,9 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
|
||||
qDebug("Temporary filename is: %s", qPrintable(filePath));
|
||||
if(reply->open(QIODevice::ReadOnly)) {
|
||||
// TODO: Support GZIP compression
|
||||
tmpfile.write(reply->readAll());
|
||||
QByteArray content = reply->readAll();
|
||||
//qDebug("Read content: %s", content.data());
|
||||
tmpfile.write(content);
|
||||
reply->close();
|
||||
tmpfile.close();
|
||||
// Send finished signal
|
||||
@ -112,7 +115,8 @@ QNetworkReply* downloadThread::downloadUrl(QString url){
|
||||
// Spoof Firefox 3.5 user agent to avoid
|
||||
// Web server banning
|
||||
request.setRawHeader("User-Agent", "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5");
|
||||
qDebug("Downloading %s...", qPrintable(request.url().toString()));
|
||||
qDebug("Downloading %s...", request.url().toEncoded().data());
|
||||
qDebug("Header: %s", qPrintable(request.header(QNetworkRequest::LocationHeader).toString()));
|
||||
return networkManager->get(request);
|
||||
}
|
||||
|
||||
|
@ -347,8 +347,11 @@ public:
|
||||
}
|
||||
|
||||
bool allFiltered() const {
|
||||
if(!rootItem->childCount()) return true;
|
||||
return (rootItem->child(0)->getPriority() == IGNORED);
|
||||
for(int i=0; i<rootItem->childCount(); ++i) {
|
||||
if(rootItem->child(i)->getPriority() != IGNORED)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int columnCount(const QModelIndex &parent=QModelIndex()) const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user