1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-10-26 06:12:17 +01:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Christophe Dumez
5ec0900b84 tagged v2.5.0beta6 release 2010-11-21 13:14:33 +00:00
116 changed files with 12662 additions and 13150 deletions

View File

@@ -76,7 +76,7 @@ Translations authors:
- Croatian: Oliver Mucafir (oliver.untwist@gmail.com) - Croatian: Oliver Mucafir (oliver.untwist@gmail.com)
- Czech: Jirka Vilim (web@tets.cz) - Czech: Jirka Vilim (web@tets.cz)
- Danish: Mathias Nielsen (comoneo@gmail.com) - Danish: Mathias Nielsen (comoneo@gmail.com)
- Dutch: Pieter Heyvaert (pieter_heyvaert@hotmail.com) - Dutch: Joost Schipper (heavyjoost@users.sourceforge.net)
- English: Christophe Dumez (chris@qbittorrent.org) - English: Christophe Dumez (chris@qbittorrent.org)
- Finnish: Niklas Laxström (nikerabbit@users.sourceforge.net) - Finnish: Niklas Laxström (nikerabbit@users.sourceforge.net)
- French: Christophe Dumez (chris@qbittorrent.org) - French: Christophe Dumez (chris@qbittorrent.org)

View File

@@ -1,4 +1,4 @@
* Sun Dec 5 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.5.0 * Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.5.0
- FEATURE: qBittorrent can now act as a tracker - FEATURE: qBittorrent can now act as a tracker
- FEATURE: New and improved RSS feed automated downloader - FEATURE: New and improved RSS feed automated downloader
- FEATURE: Added feature to shutdown qbittorrent on torrents completion - FEATURE: Added feature to shutdown qbittorrent on torrents completion
@@ -12,20 +12,9 @@
- FEATURE: Added "Amount downloaded/left" columns to transfer list - FEATURE: Added "Amount downloaded/left" columns to transfer list
- FEATURE: Simplified proxy settings - FEATURE: Simplified proxy settings
- FEATURE: Optimized and improved the peer country resolution code - FEATURE: Optimized and improved the peer country resolution code
- FEATURE: Download first/last pieces first when sequential download is
enabled (Thanks Ahmad)
- FEATURE: Download first/last pieces first now applies to all media files
in the torrent (Thanks Ahmad)
- BUGFIX: Fix SOCKS5 proxy authentication in search engine(closes #680072)
- BUGFIX: Fix two advanced settings (ignore limits on LAN and protocol
overhead inclusion in rate limiter)
- BUGFIX: Fix strict super seeding (was not working)
- BUGFIX: Improve magnet save path handling (closes #683395)
- BUGFIX: Disable overwrite confirmation in torrent addition dialog (closes # 685269)
- COSMETIC: Replaced message box by on-screen notification for download errors - COSMETIC: Replaced message box by on-screen notification for download errors
- COSMETIC: Improved the torrent creation tool appearance - COSMETIC: Improved the torrent creation tool appearance
- COSMETIC: Use country flags by Mark James (Thanks to Dmytro Pukha) - COSMETIC: Use country flags by Mark James (Thanks to Dmytro Pukha)
- COSMETIC: Use bigger alternative speed icon
- OTHERS: Dropped support for Qt <= 4.4 - OTHERS: Dropped support for Qt <= 4.4
* Tue Aug 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.0 * Tue Aug 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -68,7 +68,7 @@ class about : public QDialog, private Ui::AboutDlg{
<li><u>Croatian:</u> Oliver Mucafir (oliver.untwist@gmail.com)</li>\ <li><u>Croatian:</u> Oliver Mucafir (oliver.untwist@gmail.com)</li>\
<li><u>Czech:</u> Jirka Vilim (web@tets.cz)</li>\ <li><u>Czech:</u> Jirka Vilim (web@tets.cz)</li>\
<li><u>Danish:</u> Mathias Nielsen (comoneo@gmail.com)</li>\ <li><u>Danish:</u> Mathias Nielsen (comoneo@gmail.com)</li>\
<li><u>Dutch:</u> Pieter Heyvaert (pieter_heyvaert@hotmail.com)</li>\ <li><u>Dutch:</u> Joost Schipper (heavyjoost@users.sourceforge.net) and Peter Koeleman (peter@peerweb.nl)</li>\
<li><u>Finnish:</u> Niklas Laxström (nikerabbit@users.sourceforge.net) and Pekka Niemi (pekka.niemi@iki.fi)</li>\ <li><u>Finnish:</u> Niklas Laxström (nikerabbit@users.sourceforge.net) and Pekka Niemi (pekka.niemi@iki.fi)</li>\
<li><u>German:</u> Niels Hoffmann (zentralmaschine@users.sourceforge.net)</li>\ <li><u>German:</u> Niels Hoffmann (zentralmaschine@users.sourceforge.net)</li>\
<li><u>Greek:</u> Tsvetan Bankov (emerge_life@users.sourceforge.net)</li>\ <li><u>Greek:</u> Tsvetan Bankov (emerge_life@users.sourceforge.net)</li>\

View File

@@ -34,6 +34,8 @@
#include "qbtsession.h" #include "qbtsession.h"
#include "ui_console.h" #include "ui_console.h"
using namespace libtorrent;
class consoleDlg : public QDialog, private Ui_ConsoleDlg{ class consoleDlg : public QDialog, private Ui_ConsoleDlg{
Q_OBJECT Q_OBJECT

View File

@@ -1,55 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0" >
<ui version="4.0"> <author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>downloadFromURL</class> <class>downloadFromURL</class>
<widget class="QDialog" name="downloadFromURL"> <widget class="QDialog" name="downloadFromURL" >
<property name="geometry"> <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>482</width> <width>360</width>
<height>220</height> <height>220</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle" >
<string>Download from urls</string> <string>Download from urls</string>
</property> </property>
<layout class="QVBoxLayout"> <layout class="QVBoxLayout" >
<property name="spacing"> <property name="margin" >
<number>6</number>
</property>
<property name="margin">
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" >
<number>6</number>
</property>
<item> <item>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout" >
<property name="spacing"> <property name="margin" >
<number>6</number>
</property>
<property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" >
<number>6</number>
</property>
<item> <item>
<widget class="QLabel" name="icon_lbl"> <widget class="QLabel" name="icon_lbl" >
<property name="minimumSize"> <property name="minimumSize" >
<size> <size>
<width>32</width> <width>32</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize" >
<size> <size>
<width>32</width> <width>32</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text" >
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="downloadURL_lbl"> <widget class="QLabel" name="downloadURL_lbl" >
<property name="font"> <property name="font" >
<font> <font>
<family>Sans Serif</family> <family>Sans Serif</family>
<pointsize>12</pointsize> <pointsize>12</pointsize>
@@ -60,7 +62,7 @@
<strikeout>false</strikeout> <strikeout>false</strikeout>
</font> </font>
</property> </property>
<property name="text"> <property name="text" >
<string>Download Torrents from URLs</string> <string>Download Torrents from URLs</string>
</property> </property>
</widget> </widget>
@@ -68,21 +70,21 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QTextEdit" name="textUrls"> <widget class="QTextEdit" name="textUrls" >
<property name="acceptRichText"> <property name="acceptRichText" >
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_infos"> <widget class="QLabel" name="label_infos" >
<property name="maximumSize"> <property name="maximumSize" >
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>17</height> <height>17</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font" >
<font> <font>
<family>Sans Serif</family> <family>Sans Serif</family>
<pointsize>9</pointsize> <pointsize>9</pointsize>
@@ -93,25 +95,25 @@
<strikeout>false</strikeout> <strikeout>false</strikeout>
</font> </font>
</property> </property>
<property name="text"> <property name="text" >
<string>Only one URL per line</string> <string>Only one URL per line</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout" >
<property name="spacing"> <property name="margin" >
<number>6</number>
</property>
<property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" >
<number>6</number>
</property>
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" >
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@@ -120,25 +122,25 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="downloadButton"> <widget class="QPushButton" name="downloadButton" >
<property name="text"> <property name="text" >
<string>Download</string> <string>Download</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="cancelButton"> <widget class="QPushButton" name="cancelButton" >
<property name="text"> <property name="text" >
<string>Cancel</string> <string>Cancel</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" >
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@@ -150,6 +152,7 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<pixmapfunction></pixmapfunction>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@@ -45,14 +45,14 @@
/** Download Thread **/ /** Download Thread **/
downloadThread::downloadThread(QObject* parent) : QObject(parent) { downloadThread::downloadThread(QObject* parent) : QObject(parent) {
connect(&m_networkManager, SIGNAL(finished (QNetworkReply*)), this, SLOT(processDlFinished(QNetworkReply*))); connect(&networkManager, SIGNAL(finished (QNetworkReply*)), this, SLOT(processDlFinished(QNetworkReply*)));
#ifndef QT_NO_OPENSSL #ifndef QT_NO_OPENSSL
connect(&m_networkManager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), this, SLOT(ignoreSslErrors(QNetworkReply*,QList<QSslError>))); connect(&networkManager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), this, SLOT(ignoreSslErrors(QNetworkReply*,QList<QSslError>)));
#endif #endif
} }
void downloadThread::processDlFinished(QNetworkReply* reply) { void downloadThread::processDlFinished(QNetworkReply* reply) {
QString url = reply->url().toString(); QString url = reply->url().toEncoded().data();
qDebug("Download finished: %s", qPrintable(url)); qDebug("Download finished: %s", qPrintable(url));
if(reply->error() != QNetworkReply::NoError) { if(reply->error() != QNetworkReply::NoError) {
// Failure // Failure
@@ -63,13 +63,13 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
if(redirection.isValid()) { if(redirection.isValid()) {
// We should redirect // We should redirect
qDebug("Redirecting from %s to %s", qPrintable(url), qPrintable(redirection.toUrl().toString())); qDebug("Redirecting from %s to %s", qPrintable(url), qPrintable(redirection.toUrl().toString()));
m_redirectMapping.insert(redirection.toUrl().toString(), url); redirect_mapping.insert(redirection.toUrl().toString(), url);
downloadUrl(redirection.toUrl().toString()); downloadUrl(redirection.toUrl().toString());
return; return;
} }
// Checking if it was redirecting, restoring initial URL // Checking if it was redirecting, restoring initial URL
if(m_redirectMapping.contains(url)) { if(redirect_mapping.contains(url)) {
url = m_redirectMapping.take(url); url = redirect_mapping.take(url);
} }
// Success // Success
QString filePath; QString filePath;
@@ -104,7 +104,7 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
#ifndef DISABLE_GUI #ifndef DISABLE_GUI
void downloadThread::loadCookies(const QString &host_name, QString url) { void downloadThread::loadCookies(const QString &host_name, QString url) {
const QList<QByteArray> raw_cookies = RssSettings().getHostNameCookies(host_name); const QList<QByteArray> raw_cookies = RssSettings().getHostNameCookies(host_name);
QNetworkCookieJar *cookie_jar = m_networkManager.cookieJar(); QNetworkCookieJar *cookie_jar = networkManager.cookieJar();
QList<QNetworkCookie> cookies; QList<QNetworkCookie> cookies;
qDebug("Loading cookies for host name: %s", qPrintable(host_name)); qDebug("Loading cookies for host name: %s", qPrintable(host_name));
foreach(const QByteArray& raw_cookie, raw_cookies) { foreach(const QByteArray& raw_cookie, raw_cookies) {
@@ -115,7 +115,7 @@ void downloadThread::loadCookies(const QString &host_name, QString url) {
} }
} }
cookie_jar->setCookiesFromUrl(cookies, url); cookie_jar->setCookiesFromUrl(cookies, url);
m_networkManager.setCookieJar(cookie_jar); networkManager.setCookieJar(cookie_jar);
} }
#endif #endif
@@ -148,12 +148,12 @@ QNetworkReply* downloadThread::downloadUrl(QString url){
// Web server banning // 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"); 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...", request.url().toEncoded().data()); qDebug("Downloading %s...", request.url().toEncoded().data());
qDebug("%d cookies for this URL", m_networkManager.cookieJar()->cookiesForUrl(url).size()); qDebug("%d cookies for this URL", networkManager.cookieJar()->cookiesForUrl(url).size());
for(int i=0; i<m_networkManager.cookieJar()->cookiesForUrl(url).size(); ++i) { for(int i=0; i<networkManager.cookieJar()->cookiesForUrl(url).size(); ++i) {
qDebug("%s=%s", m_networkManager.cookieJar()->cookiesForUrl(url).at(i).name().data(), m_networkManager.cookieJar()->cookiesForUrl(url).at(i).value().data()); qDebug("%s=%s", networkManager.cookieJar()->cookiesForUrl(url).at(i).name().data(), networkManager.cookieJar()->cookiesForUrl(url).at(i).value().data());
qDebug("Domain: %s, Path: %s", qPrintable(m_networkManager.cookieJar()->cookiesForUrl(url).at(i).domain()), qPrintable(m_networkManager.cookieJar()->cookiesForUrl(url).at(i).path())); qDebug("Domain: %s, Path: %s", qPrintable(networkManager.cookieJar()->cookiesForUrl(url).at(i).domain()), qPrintable(networkManager.cookieJar()->cookiesForUrl(url).at(i).path()));
} }
return m_networkManager.get(request); return networkManager.get(request);
} }
void downloadThread::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal) { void downloadThread::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal) {
@@ -200,7 +200,7 @@ void downloadThread::applyProxySettings() {
} else { } else {
proxy.setType(QNetworkProxy::NoProxy); proxy.setType(QNetworkProxy::NoProxy);
} }
m_networkManager.setProxy(proxy); networkManager.setProxy(proxy);
} }
QString downloadThread::errorCodeToString(QNetworkReply::NetworkError status) { QString downloadThread::errorCodeToString(QNetworkReply::NetworkError status) {

View File

@@ -41,33 +41,33 @@ class QNetworkAccessManager;
class downloadThread : public QObject { class downloadThread : public QObject {
Q_OBJECT Q_OBJECT
public: private:
downloadThread(QObject* parent = 0); QNetworkAccessManager networkManager;
QNetworkReply* downloadUrl(QString url); QHash<QString, QString> redirect_mapping;
void downloadTorrentUrl(QString url);
//void setProxy(QString IP, int port, QString username, QString password);
signals: signals:
void downloadFinished(QString url, QString file_path); void downloadFinished(QString url, QString file_path);
void downloadFailure(QString url, QString reason); void downloadFailure(QString url, QString reason);
private slots: public:
void processDlFinished(QNetworkReply* reply); downloadThread(QObject* parent);
void checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal); QNetworkReply* downloadUrl(QString url);
#ifndef QT_NO_OPENSSL void downloadTorrentUrl(QString url);
void ignoreSslErrors(QNetworkReply*,QList<QSslError>); //void setProxy(QString IP, int port, QString username, QString password);
#endif
private: protected:
QString errorCodeToString(QNetworkReply::NetworkError status); QString errorCodeToString(QNetworkReply::NetworkError status);
void applyProxySettings(); void applyProxySettings();
#ifndef DISABLE_GUI #ifndef DISABLE_GUI
void loadCookies(const QString &host_name, QString url); void loadCookies(const QString &host_name, QString url);
#endif #endif
private: protected slots:
QNetworkAccessManager m_networkManager; void processDlFinished(QNetworkReply* reply);
QHash<QString, QString> m_redirectMapping; void checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal);
#ifndef QT_NO_OPENSSL
void ignoreSslErrors(QNetworkReply*,QList<QSslError>);
#endif
}; };

View File

@@ -40,6 +40,7 @@
#include <libtorrent/session.hpp> #include <libtorrent/session.hpp>
#include <libtorrent/ip_filter.hpp> #include <libtorrent/ip_filter.hpp>
using namespace libtorrent;
using namespace std; using namespace std;
// P2B Stuff // P2B Stuff
@@ -55,8 +56,8 @@ class FilterParserThread : public QThread {
Q_OBJECT Q_OBJECT
private: private:
libtorrent::session *s; session *s;
libtorrent::ip_filter filter; ip_filter filter;
bool abort; bool abort;
QString filePath; QString filePath;
@@ -93,7 +94,7 @@ protected:
} }
public: public:
FilterParserThread(QObject* parent, libtorrent::session *s) : QThread(parent), s(s), abort(false) { FilterParserThread(QObject* parent, session *s) : QThread(parent), s(s), abort(false) {
} }
@@ -176,7 +177,7 @@ public:
} }
// Now Add to the filter // Now Add to the filter
try { try {
filter.add_rule(startAddr, endAddr, libtorrent::ip_filter::blocked); filter.add_rule(startAddr, endAddr, ip_filter::blocked);
}catch(exception){ }catch(exception){
qDebug("Bad line in filter file, avoided crash..."); qDebug("Bad line in filter file, avoided crash...");
} }
@@ -245,7 +246,7 @@ public:
continue; continue;
} }
try { try {
filter.add_rule(startAddr, endAddr, libtorrent::ip_filter::blocked); filter.add_rule(startAddr, endAddr, ip_filter::blocked);
} catch(std::exception&) { } catch(std::exception&) {
qDebug("p2p file: line %d is malformed.", nbLine); qDebug("p2p file: line %d is malformed.", nbLine);
qDebug("Line was: %s", line.constData()); qDebug("Line was: %s", line.constData());
@@ -312,10 +313,10 @@ public:
// Network byte order to Host byte order // Network byte order to Host byte order
// asio address_v4 contructor expects it // asio address_v4 contructor expects it
// that way // that way
libtorrent::address_v4 first(ntohl(start)); address_v4 first(ntohl(start));
libtorrent::address_v4 last(ntohl(end)); address_v4 last(ntohl(end));
// Apply to bittorrent session // Apply to bittorrent session
filter.add_rule(first, last, libtorrent::ip_filter::blocked); filter.add_rule(first, last, ip_filter::blocked);
} }
} }
else if(version==3) { else if(version==3) {
@@ -357,10 +358,10 @@ public:
// Network byte order to Host byte order // Network byte order to Host byte order
// asio address_v4 contructor expects it // asio address_v4 contructor expects it
// that way // that way
libtorrent::address_v4 first(ntohl(start)); address_v4 first(ntohl(start));
libtorrent::address_v4 last(ntohl(end)); address_v4 last(ntohl(end));
// Apply to bittorrent session // Apply to bittorrent session
filter.add_rule(first, last, libtorrent::ip_filter::blocked); filter.add_rule(first, last, ip_filter::blocked);
if(abort) return; if(abort) return;
} }
} else { } else {
@@ -390,16 +391,16 @@ public:
start(); start();
} }
static void processFilterList(libtorrent::session *s, QStringList IPs) { static void processFilterList(session *s, QStringList IPs) {
// First, import current filter // First, import current filter
libtorrent::ip_filter filter = s->get_ip_filter(); ip_filter filter = s->get_ip_filter();
foreach(const QString &ip, IPs) { foreach(const QString &ip, IPs) {
qDebug("Manual ban of peer %s", ip.toLocal8Bit().constData()); qDebug("Manual ban of peer %s", ip.toLocal8Bit().constData());
boost::system::error_code ec; boost::system::error_code ec;
libtorrent::address_v4 addr = libtorrent::address_v4::from_string(ip.toLocal8Bit().constData(), ec); address_v4 addr = address_v4::from_string(ip.toLocal8Bit().constData(), ec);
Q_ASSERT(!ec); Q_ASSERT(!ec);
if(!ec) if(!ec)
filter.add_rule(addr, addr, libtorrent::ip_filter::blocked); filter.add_rule(addr, addr, ip_filter::blocked);
} }
s->set_ip_filter(filter); s->set_ip_filter(filter);
} }

View File

@@ -118,7 +118,9 @@ void GeoIPManager::loadDatabase(session *s) {
#endif #endif
if(QFile::exists(geoipDBpath(false))) { if(QFile::exists(geoipDBpath(false))) {
qDebug("Loading GeoIP database from %s...", qPrintable(geoipDBpath(false))); qDebug("Loading GeoIP database from %s...", qPrintable(geoipDBpath(false)));
s->load_country_db(geoipDBpath(false).toLocal8Bit().constData()); if(!s->load_country_db(geoipDBpath(false).toLocal8Bit().constData())) {
std::cerr << "Failed to load Geoip Database at " << qPrintable(geoipDBpath(false)) << std::endl;
}
} else { } else {
qDebug("ERROR: Impossible to find local Geoip Database"); qDebug("ERROR: Impossible to find local Geoip Database");
} }

View File

@@ -40,14 +40,15 @@ class HeadlessLoader: public QObject {
Q_OBJECT Q_OBJECT
public: public:
HeadlessLoader(const QStringList &torrentCmdLine) { HeadlessLoader(QStringList torrentCmdLine) {
Preferences pref; Preferences pref;
// Enable Web UI // Enable Web UI
pref.setWebUiEnabled(true); pref.setWebUiEnabled(true);
// Instanciate Bittorrent Object // Instanciate Bittorrent Object
connect(QBtSession::instance(), SIGNAL(newConsoleMessage(QString)), this, SLOT(displayConsoleMessage(QString))); BTSession = QBtSession::instance();
connect(BTSession, SIGNAL(newConsoleMessage(QString)), this, SLOT(displayConsoleMessage(QString)));
// Resume unfinished torrents // Resume unfinished torrents
QBtSession::instance()->startUpTorrents(); BTSession->startUpTorrents();
// Process command line parameters // Process command line parameters
processParams(torrentCmdLine); processParams(torrentCmdLine);
// Display some information to the user // Display some information to the user
@@ -71,7 +72,7 @@ public slots:
qApp->quit(); qApp->quit();
} }
void displayConsoleMessage(const QString &msg) { void displayConsoleMessage(QString msg) {
std::cout << qPrintable(msg) << std::endl; std::cout << qPrintable(msg) << std::endl;
} }
@@ -87,21 +88,24 @@ public slots:
foreach(QString param, params) { foreach(QString param, params) {
param = param.trimmed(); param = param.trimmed();
if(param.startsWith(QString::fromUtf8("http://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("ftp://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("https://"), Qt::CaseInsensitive)) { if(param.startsWith(QString::fromUtf8("http://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("ftp://"), Qt::CaseInsensitive) || param.startsWith(QString::fromUtf8("https://"), Qt::CaseInsensitive)) {
QBtSession::instance()->downloadFromUrl(param); BTSession->downloadFromUrl(param);
}else{ }else{
if(param.startsWith("bc://bt/", Qt::CaseInsensitive)) { if(param.startsWith("bc://bt/", Qt::CaseInsensitive)) {
qDebug("Converting bc link to magnet link"); qDebug("Converting bc link to magnet link");
param = misc::bcLinkToMagnet(param); param = misc::bcLinkToMagnet(param);
} }
if(param.startsWith("magnet:", Qt::CaseInsensitive)) { if(param.startsWith("magnet:", Qt::CaseInsensitive)) {
QBtSession::instance()->addMagnetUri(param); BTSession->addMagnetUri(param);
} else { } else {
QBtSession::instance()->addTorrent(param); BTSession->addTorrent(param);
} }
} }
} }
} }
private:
QBtSession *BTSession;
}; };
#endif #endif

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More