|
|
|
@ -55,12 +55,15 @@ subDownloadThread::subDownloadThread(QObject *parent, QString url) : QThread(par
@@ -55,12 +55,15 @@ subDownloadThread::subDownloadThread(QObject *parent, QString url) : QThread(par
|
|
|
|
|
url_stream = new ost::URLStream(); |
|
|
|
|
// Proxy support
|
|
|
|
|
QSettings settings("qBittorrent", "qBittorrent"); |
|
|
|
|
int intValue = settings.value(QString::fromUtf8("[Preferences/Connection/ProxyType"), 0).toInt(); |
|
|
|
|
int intValue = settings.value(QString::fromUtf8("Preferences/Connection/ProxyType"), 0).toInt(); |
|
|
|
|
if(intValue > 0) { |
|
|
|
|
// Proxy enabled
|
|
|
|
|
qDebug("Set proxy, hostname: %s, port: %d", 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()); |
|
|
|
|
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()) { |
|
|
|
|
qDebug("Proxy auth required"); |
|
|
|
|
// Authentication required
|
|
|
|
|
url_stream->setProxyAuthentication(ost::URLStream::authBasic, "auth"); |
|
|
|
|
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()); |
|
|
|
|
} |
|
|
|
|