Browse Source

- Make everything compile back with libtorrent v0.14

- Fix crash in search engine destructor if downloads are running
adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
4ca2d060ea
  1. 26
      Changelog
  2. 2
      INSTALL
  3. 9
      configure
  4. 9
      qcm/libtorrent-rasterbar.qcm
  5. 9
      src/bittorrent.cpp
  6. 2
      src/downloadThread.cpp
  7. 4
      src/qtorrenthandle.cpp
  8. 4
      src/qtorrenthandle.h
  9. 4
      src/searchEngine.cpp
  10. 5
      src/torrentAddition.h
  11. 3
      src/torrentPersistentData.h

26
Changelog

@ -1,19 +1,6 @@
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v2.0.0 * Unknown - Christophe Dumez <chris@qbittorrent.org> - v2.0.0
- FEATURE: Added per-torrent super seeding mode
- FEATURE: Added program option to disable splash screen - FEATURE: Added program option to disable splash screen
- FEATURE: Support for storing symbolic links in .torrent files
- FEATURE: Support for uTorrent interpretation of multi-tracker torrents
- FEATURE: Handle torrents with duplicate filenames
- FEATURE: Support for merkle hash tree torrents (.merkle.torrent)
- FEATURE: Metadata download from swarm is now compatible with µtorrent
- FEATURE: Support tracker exchange between peers
- FEATURE: Better http seed support
- FEATURE: Tracker connections are now also subject to IP filtering
- FEATURE: Include DHT traffic in the rate limiter
- FEATURE: Support for bitcomet padding files
- FEATURE: Option to skip file checking and start seeding immediately in torrent addition dialog (Stephanos Antaris)
- FEATURE: Dropped dependency on libcurl and libzzip - FEATURE: Dropped dependency on libcurl and libzzip
- FEATURE: Dropped Qt 4.3 support (Qt >= 4.4 is required)
- FEATURE: Display more information regarding the torrent in its properties - FEATURE: Display more information regarding the torrent in its properties
- FEATURE: Various optimizations to save CPU and memory - FEATURE: Various optimizations to save CPU and memory
- FEATURE: Folder scanning now works with CIFS and NFS mounted folders - FEATURE: Folder scanning now works with CIFS and NFS mounted folders
@ -25,6 +12,19 @@
- FEATURE: New peers can manually be added to the torrents - FEATURE: New peers can manually be added to the torrents
- FEATURE: Support per-peer rate limiting - FEATURE: Support per-peer rate limiting
- FEATURE: Support peer manual ban - FEATURE: Support peer manual ban
- FEATURE: Dropped Qt 4.3 support (Qt >= 4.4 is now required)
- FEATURE: Added per-torrent super seeding mode (libtorrent >= v0.15 only)
- FEATURE: Support for storing symbolic links in .torrent files (libtorrent >= v0.15 only)
- FEATURE: Support for uTorrent interpretation of multi-tracker torrents (libtorrent >= v0.15 only)
- FEATURE: Handle torrents with duplicate filenames (libtorrent >= v0.15 only)
- FEATURE: Support for merkle hash tree torrents (.merkle.torrent) (libtorrent >= v0.15 only)
- FEATURE: Metadata download from swarm is now compatible with µtorrent (libtorrent >= v0.15 only)
- FEATURE: Support tracker exchange between peers (libtorrent >= v0.15 only)
- FEATURE: Better http seed support (libtorrent >= v0.15 only)
- FEATURE: Tracker connections are now also subject to IP filtering (libtorrent >= v0.15 only)
- FEATURE: Include DHT traffic in the rate limiter (libtorrent >= v0.15 only)
- FEATURE: Support for bitcomet padding files (libtorrent >= v0.15 only)
- FEATURE: Option to skip file checking and start seeding immediately in torrent addition dialog (Stephanos Antaris) (libtorrent >= v0.15 only)
- COSMETIC: Merged download / upload lists - COSMETIC: Merged download / upload lists
- COSMETIC: Torrents can be filtered based on their status - COSMETIC: Torrents can be filtered based on their status
- COSMETIC: Torrent properties are now displayed in main window - COSMETIC: Torrent properties are now displayed in main window

2
INSTALL

@ -10,7 +10,7 @@ will install and execute qBittorrent hopefully without any problems.
Dependencies: Dependencies:
- Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml) - Qt >= 4.4.0 (libqt-devel, libqtgui, libqtcore, libqtnetwork, libqtxml)
- libtorrent-rasterbar by Arvid Norberg (>= v0.15.0 REQUIRED) - libtorrent-rasterbar by Arvid Norberg (>= 0.14.0 REQUIRED, >= v0.15.0 ADVISED)
-> http://www.qbittorrent.org/download.php (advised) -> http://www.qbittorrent.org/download.php (advised)
-> http://www.libtorrent.net -> http://www.libtorrent.net
Be careful: another library (the one used by rTorrent) uses a similar name. Be careful: another library (the one used by rTorrent) uses a similar name.

9
configure vendored

@ -292,11 +292,12 @@ class qc_libtorrent_rasterbar : public ConfObj
{ {
public: public:
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {} qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent-rasterbar >= 0.15.0"; } QString name() const { return "libtorrent-rasterbar >= 0.14.0 (>= 0.15.0 advised)"; }
QString shortname() const { return "libtorrent-rasterbar"; } QString shortname() const { return "libtorrent-rasterbar"; }
bool exec(){ bool exec(){
QStringList incs; QStringList incs;
QString req_ver = "0.15.0"; QString req_ver = "0.14.0";
QString adv_ver = "0.15.0";
QString version, libs, other; QString version, libs, other;
VersionMode mode = VersionMin; VersionMode mode = VersionMin;
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other)) if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
@ -305,6 +306,10 @@ public:
conf->addIncludePath(incs[n]); conf->addIncludePath(incs[n]);
if(!libs.isEmpty()) if(!libs.isEmpty())
conf->addLib(libs); conf->addLib(libs);
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
printf("\nWarning: libtorrent-rasterbar v%s was detected.\nAlthough it will compile and run, you will be missing some features. Please consider updating to v%s.\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
else
conf->addDefine("LIBTORRENT_0_15");
return true; return true;
} }
}; };

9
qcm/libtorrent-rasterbar.qcm

@ -8,11 +8,12 @@ class qc_libtorrent_rasterbar : public ConfObj
{ {
public: public:
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {} qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent-rasterbar >= 0.15.0"; } QString name() const { return "libtorrent-rasterbar >= 0.14.0 (>= 0.15.0 advised)"; }
QString shortname() const { return "libtorrent-rasterbar"; } QString shortname() const { return "libtorrent-rasterbar"; }
bool exec(){ bool exec(){
QStringList incs; QStringList incs;
QString req_ver = "0.15.0"; QString req_ver = "0.14.0";
QString adv_ver = "0.15.0";
QString version, libs, other; QString version, libs, other;
VersionMode mode = VersionMin; VersionMode mode = VersionMin;
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other)) if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
@ -21,6 +22,10 @@ public:
conf->addIncludePath(incs[n]); conf->addIncludePath(incs[n]);
if(!libs.isEmpty()) if(!libs.isEmpty())
conf->addLib(libs); conf->addLib(libs);
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
printf("\nWarning: libtorrent-rasterbar v%s was detected.\nAlthough it will compile and run, you will be missing some features. Please consider updating to v%s.\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
else
conf->addDefine("LIBTORRENT_0_15");
return true; return true;
} }
}; };

9
src/bittorrent.cpp

@ -43,7 +43,9 @@
#include "geoip.h" #include "geoip.h"
#include "torrentPersistentData.h" #include "torrentPersistentData.h"
#include <libtorrent/extensions/ut_metadata.hpp> #include <libtorrent/extensions/ut_metadata.hpp>
#include <libtorrent/extensions/lt_trackers.hpp> #ifdef LIBTORRENT_0_15
#include <libtorrent/extensions/lt_trackers.hpp>
#endif
#include <libtorrent/extensions/ut_pex.hpp> #include <libtorrent/extensions/ut_pex.hpp>
#include <libtorrent/extensions/smart_ban.hpp> #include <libtorrent/extensions/smart_ban.hpp>
//#include <libtorrent/extensions/metadata_transfer.hpp> //#include <libtorrent/extensions/metadata_transfer.hpp>
@ -81,7 +83,9 @@ bittorrent::bittorrent() : DHTEnabled(false), preAllocateAll(false), addInPause(
// Enabling plugins // Enabling plugins
//s->add_extension(&create_metadata_plugin); //s->add_extension(&create_metadata_plugin);
s->add_extension(&create_ut_metadata_plugin); s->add_extension(&create_ut_metadata_plugin);
#ifdef LIBTORRENT_0_15
s->add_extension(create_lt_trackers_plugin); s->add_extension(create_lt_trackers_plugin);
#endif
s->add_extension(&create_ut_pex_plugin); s->add_extension(&create_ut_pex_plugin);
s->add_extension(&create_smart_ban_plugin); s->add_extension(&create_smart_ban_plugin);
timerAlerts = new QTimer(); timerAlerts = new QTimer();
@ -831,13 +835,14 @@ QTorrentHandle bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
p.save_path = defaultTempPath.toLocal8Bit().data(); p.save_path = defaultTempPath.toLocal8Bit().data();
} }
#ifdef LIBTORRENT_0_15
// Skip checking and directly start seeding (new in libtorrent v0.15) // Skip checking and directly start seeding (new in libtorrent v0.15)
if(TorrentTempData::isSeedingMode(hash)){ if(TorrentTempData::isSeedingMode(hash)){
p.seed_mode=true; p.seed_mode=true;
} else { } else {
p.seed_mode=false; p.seed_mode=false;
} }
#endif
// TODO: Remove in v1.6.0: For backward compatibility only // TODO: Remove in v1.6.0: For backward compatibility only
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished")) { if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished")) {
p.save_path = savePath.toLocal8Bit().data(); p.save_path = savePath.toLocal8Bit().data();

2
src/downloadThread.cpp

@ -43,7 +43,9 @@ downloadThread::downloadThread(QObject* parent) : QObject(parent) {
} }
downloadThread::~downloadThread(){ downloadThread::~downloadThread(){
qDebug("Deleting network manager");
delete networkManager; delete networkManager;
qDebug("Deleted network manager");
} }
void downloadThread::processDlFinished(QNetworkReply* reply) { void downloadThread::processDlFinished(QNetworkReply* reply) {

4
src/qtorrenthandle.cpp

@ -179,10 +179,12 @@ QString QTorrentHandle::save_path() const {
return misc::toQString(h.save_path().string()); return misc::toQString(h.save_path().string());
} }
#ifdef LIBTORRENT_0_15
bool QTorrentHandle::super_seeding() const { bool QTorrentHandle::super_seeding() const {
Q_ASSERT(h.is_valid()); Q_ASSERT(h.is_valid());
return h.super_seeding(); return h.super_seeding();
} }
#endif
QStringList QTorrentHandle::url_seeds() const { QStringList QTorrentHandle::url_seeds() const {
Q_ASSERT(h.is_valid()); Q_ASSERT(h.is_valid());
@ -493,10 +495,12 @@ void QTorrentHandle::file_priority(int index, int priority) const {
h.file_priority(index, priority); h.file_priority(index, priority);
} }
#ifdef LIBTORRENT_0_15
void QTorrentHandle::super_seeding(bool on) const { void QTorrentHandle::super_seeding(bool on) const {
Q_ASSERT(h.is_valid()); Q_ASSERT(h.is_valid());
h.super_seeding(on); h.super_seeding(on);
} }
#endif
void QTorrentHandle::resolve_countries(bool r) { void QTorrentHandle::resolve_countries(bool r) {
Q_ASSERT(h.is_valid()); Q_ASSERT(h.is_valid());

4
src/qtorrenthandle.h

@ -115,7 +115,9 @@ class QTorrentHandle {
qlonglong seeding_time() const; qlonglong seeding_time() const;
std::vector<int> file_priorities() const; std::vector<int> file_priorities() const;
bool is_sequential_download() const; bool is_sequential_download() const;
#ifdef LIBTORRENT_0_15
bool super_seeding() const; bool super_seeding() const;
#endif
QString creation_date() const; QString creation_date() const;
void get_peer_info(std::vector<peer_info>&) const; void get_peer_info(std::vector<peer_info>&) const;
bool resolve_countries() const; bool resolve_countries() const;
@ -144,7 +146,9 @@ class QTorrentHandle {
void auto_managed(bool) const; void auto_managed(bool) const;
void force_recheck() const; void force_recheck() const;
void move_storage(QString path) const; void move_storage(QString path) const;
#ifdef LIBTORRENT_0_15
void super_seeding(bool on) const; void super_seeding(bool on) const;
#endif
void resolve_countries(bool r); void resolve_countries(bool r);
void connect_peer(asio::ip::tcp::endpoint const& adr, int source = 0) const; void connect_peer(asio::ip::tcp::endpoint const& adr, int source = 0) const;
void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const; void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;

4
src/searchEngine.cpp

@ -108,7 +108,7 @@ SearchEngine::~SearchEngine(){
foreach(QProcess *downloader, downloaders) { foreach(QProcess *downloader, downloaders) {
downloader->kill(); downloader->kill();
downloader->waitForFinished(); downloader->waitForFinished();
delete downloader; //delete downloader;
} }
delete searchTimeout; delete searchTimeout;
delete searchProcess; delete searchProcess;
@ -336,7 +336,7 @@ void SearchEngine::downloadFinished(int exitcode, QProcess::ExitStatus) {
} }
} }
qDebug("Deleting downloadProcess"); qDebug("Deleting downloadProcess");
downloaders.removeAll(downloadProcess); downloaders.removeOne(downloadProcess);
delete downloadProcess; delete downloadProcess;
} }

5
src/torrentAddition.h

@ -97,6 +97,9 @@ public:
addInPause->setChecked(true); addInPause->setChecked(true);
addInPause->setEnabled(false); addInPause->setEnabled(false);
} }
#ifndef LIBTORRENT_0_15
addInSeed->setEnabled(false);
#endif
} }
~torrentAdditionDialog() { ~torrentAdditionDialog() {
@ -297,6 +300,7 @@ public slots:
settings.setValue(QString::fromUtf8("LastDirTorrentAdd"), savePathTxt->text()); settings.setValue(QString::fromUtf8("LastDirTorrentAdd"), savePathTxt->text());
// Create .incremental file if necessary // Create .incremental file if necessary
TorrentTempData::setSequential(hash, checkIncrementalDL->isChecked()); TorrentTempData::setSequential(hash, checkIncrementalDL->isChecked());
#ifdef LIBTORRENT_0_15
// Skip file checking and directly start seeding // Skip file checking and directly start seeding
if(addInSeed->isChecked()) { if(addInSeed->isChecked()) {
// Check if local file(s) actually exist // Check if local file(s) actually exist
@ -307,6 +311,7 @@ public slots:
return; return;
} }
} }
#endif
// Check if there is at least one selected file // Check if there is at least one selected file
if(allFiltered()){ if(allFiltered()){
QMessageBox::warning(0, tr("Invalid file selection"), tr("You must select at least one file in the torrent")); QMessageBox::warning(0, tr("Invalid file selection"), tr("You must select at least one file in the torrent"));

3
src/torrentPersistentData.h

@ -99,6 +99,7 @@ public:
} }
#ifdef LIBTORRENT_0_15
static void setSeedingMode(QString hash,bool seed){ static void setSeedingMode(QString hash,bool seed){
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume")); QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume"));
QHash<QString, QVariant> all_data = settings.value("torrents-tmp", QHash<QString, QVariant>()).toHash(); QHash<QString, QVariant> all_data = settings.value("torrents-tmp", QHash<QString, QVariant>()).toHash();
@ -116,7 +117,7 @@ public:
return data["seeding"].toBool(); return data["seeding"].toBool();
return false; return false;
} }
#endif
static QString getSavePath(QString hash) { static QString getSavePath(QString hash) {
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume")); QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume"));

Loading…
Cancel
Save