Browse Source

Fix qbittorrent-nox compilation errors

Silent a compilation warning in qbtsession when using libtorrent v0.14.x
adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
299b0f90bc
  1. 12
      src/downloadthread.cpp
  2. 2
      src/downloadthread.h
  3. 2
      src/qtlibtorrent/qbtsession.cpp

12
src/downloadthread.cpp

@ -37,7 +37,9 @@ @@ -37,7 +37,9 @@
#include "downloadthread.h"
#include "preferences.h"
#include "rsssettings.h"
#ifndef DISABLE_GUI
#include "rsssettings.h"
#endif
#include "qinisettings.h"
/** Download Thread **/
@ -99,6 +101,7 @@ void downloadThread::processDlFinished(QNetworkReply* reply) { @@ -99,6 +101,7 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
reply->deleteLater();
}
#ifndef DISABLE_GUI
void downloadThread::loadCookies(const QString &host_name, QString url) {
const QList<QByteArray> raw_cookies = RssSettings().getHostNameCookies(host_name);
QNetworkCookieJar *cookie_jar = networkManager.cookieJar();
@ -114,12 +117,15 @@ void downloadThread::loadCookies(const QString &host_name, QString url) { @@ -114,12 +117,15 @@ void downloadThread::loadCookies(const QString &host_name, QString url) {
cookie_jar->setCookiesFromUrl(cookies, url);
networkManager.setCookieJar(cookie_jar);
}
#endif
void downloadThread::downloadTorrentUrl(QString url){
void downloadThread::downloadTorrentUrl(QString url) {
#ifndef DISABLE_GUI
// Load cookies
QString host_name = QUrl::fromEncoded(url.toLocal8Bit()).host();
if(!host_name.isEmpty())
loadCookies(host_name, url);
#endif
// Process request
QNetworkReply *reply = downloadUrl(url);
connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(checkDownloadSize(qint64,qint64)));
@ -128,10 +134,12 @@ void downloadThread::downloadTorrentUrl(QString url){ @@ -128,10 +134,12 @@ void downloadThread::downloadTorrentUrl(QString url){
QNetworkReply* downloadThread::downloadUrl(QString url){
// Update proxy settings
applyProxySettings();
#ifndef DISABLE_GUI
// Load cookies
QString host_name = QUrl::fromEncoded(url.toLocal8Bit()).host();
if(!host_name.isEmpty())
loadCookies(host_name, url);
#endif
// Process download request
qDebug("url is %s", qPrintable(url));
const QUrl qurl = QUrl::fromEncoded(url.toLocal8Bit());

2
src/downloadthread.h

@ -58,7 +58,9 @@ public: @@ -58,7 +58,9 @@ public:
protected:
QString errorCodeToString(QNetworkReply::NetworkError status);
void applyProxySettings();
#ifndef DISABLE_GUI
void loadCookies(const QString &host_name, QString url);
#endif
protected slots:
void processDlFinished(QNetworkReply* reply);

2
src/qtlibtorrent/qbtsession.cpp

@ -1185,6 +1185,8 @@ add_torrent_params QBtSession::initializeAddTorrentParams(QString hash) { @@ -1185,6 +1185,8 @@ add_torrent_params QBtSession::initializeAddTorrentParams(QString hash) {
p.seed_mode=true;
else
p.seed_mode=false;
#else
Q_UNUSED(hash);
#endif
// Preallocation mode

Loading…
Cancel
Save