RSS: Better cookies support

This commit is contained in:
Christophe Dumez
2012-05-20 16:03:10 +03:00
parent 716e84264e
commit d55f3b5aff
5 changed files with 34 additions and 39 deletions

View File

@@ -2613,7 +2613,8 @@ QString QBtSession::getSavePath(const QString &hash, bool fromScanDir, QString f
// Take an url string to a torrent file,
// download the torrent file to a tmp location, then
// add it to download list
void QBtSession::downloadFromUrl(const QString &url) {
void QBtSession::downloadFromUrl(const QString &url, const QList<QNetworkCookie>& cookies)
{
addConsoleMessage(tr("Downloading '%1', please wait...", "e.g: Downloading 'xxx.torrent', please wait...").arg(url)
#ifndef DISABLE_GUI
, QPalette::WindowText
@@ -2621,7 +2622,7 @@ void QBtSession::downloadFromUrl(const QString &url) {
);
//emit aboutToDownloadFromUrl(url);
// Launch downloader thread
downloader->downloadTorrentUrl(url);
downloader->downloadTorrentUrl(url, cookies);
}
void QBtSession::downloadFromURLList(const QStringList& urls) {

View File

@@ -41,6 +41,7 @@
#endif
#include <QPointer>
#include <QTimer>
#include <QNetworkCookie>
#include <libtorrent/version.hpp>
#include <libtorrent/session.hpp>
@@ -107,7 +108,7 @@ public slots:
QTorrentHandle addMagnetUri(QString magnet_uri, bool resumed=false);
void loadSessionState();
void saveSessionState();
void downloadFromUrl(const QString &url);
void downloadFromUrl(const QString &url, const QList<QNetworkCookie>& cookies = QList<QNetworkCookie>());
void deleteTorrent(const QString &hash, bool delete_local_files = false);
void startUpTorrents();
void recheckTorrent(const QString &hash);