|
|
@ -22,6 +22,7 @@ |
|
|
|
#include "downloadThread.h" |
|
|
|
#include "downloadThread.h" |
|
|
|
#include <iostream> |
|
|
|
#include <iostream> |
|
|
|
#include <cc++/common.h> |
|
|
|
#include <cc++/common.h> |
|
|
|
|
|
|
|
#include <QSettings> |
|
|
|
|
|
|
|
|
|
|
|
QString subDownloadThread::errorCodeToString(int status) { |
|
|
|
QString subDownloadThread::errorCodeToString(int status) { |
|
|
|
switch(status){ |
|
|
|
switch(status){ |
|
|
@ -52,6 +53,18 @@ QString subDownloadThread::errorCodeToString(int status) { |
|
|
|
|
|
|
|
|
|
|
|
subDownloadThread::subDownloadThread(QObject *parent, QString url) : QThread(parent), url(url), abort(false){ |
|
|
|
subDownloadThread::subDownloadThread(QObject *parent, QString url) : QThread(parent), url(url), abort(false){ |
|
|
|
url_stream = new ost::URLStream(); |
|
|
|
url_stream = new ost::URLStream(); |
|
|
|
|
|
|
|
// Proxy support
|
|
|
|
|
|
|
|
QSettings settings("qBittorrent", "qBittorrent"); |
|
|
|
|
|
|
|
int intValue = settings.value(QString::fromUtf8("[Preferences/Connection/ProxyType"), 0).toInt(); |
|
|
|
|
|
|
|
if(intValue > 0) { |
|
|
|
|
|
|
|
// Proxy enabled
|
|
|
|
|
|
|
|
url_stream->setProxy(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/IP"), "0.0.0.0").toString().toUtf8().data(), settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Port"), 8080).toInt()); |
|
|
|
|
|
|
|
if(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Authentication"), false).toBool()) { |
|
|
|
|
|
|
|
// Authentication required
|
|
|
|
|
|
|
|
url_stream->setProxyUser(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Username"), QString()).toString().toUtf8().data()); |
|
|
|
|
|
|
|
url_stream->setProxyPassword(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Password"), QString()).toString().toUtf8().data()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
subDownloadThread::~subDownloadThread(){ |
|
|
|
subDownloadThread::~subDownloadThread(){ |
|
|
|