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. 7
      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 @@ @@ -1,19 +1,6 @@
* 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: 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 Qt 4.3 support (Qt >= 4.4 is required)
- FEATURE: Display more information regarding the torrent in its properties
- FEATURE: Various optimizations to save CPU and memory
- FEATURE: Folder scanning now works with CIFS and NFS mounted folders
@ -25,6 +12,19 @@ @@ -25,6 +12,19 @@
- FEATURE: New peers can manually be added to the torrents
- FEATURE: Support per-peer rate limiting
- 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: Torrents can be filtered based on their status
- COSMETIC: Torrent properties are now displayed in main window

2
INSTALL

@ -10,7 +10,7 @@ will install and execute qBittorrent hopefully without any problems. @@ -10,7 +10,7 @@ will install and execute qBittorrent hopefully without any problems.
Dependencies:
- 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.libtorrent.net
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 @@ -292,11 +292,12 @@ class qc_libtorrent_rasterbar : public ConfObj
{
public:
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"; }
bool exec(){
QStringList incs;
QString req_ver = "0.15.0";
QString req_ver = "0.14.0";
QString adv_ver = "0.15.0";
QString version, libs, other;
VersionMode mode = VersionMin;
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
@ -305,6 +306,10 @@ public: @@ -305,6 +306,10 @@ public:
conf->addIncludePath(incs[n]);
if(!libs.isEmpty())
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;
}
};

9
qcm/libtorrent-rasterbar.qcm

@ -8,11 +8,12 @@ class qc_libtorrent_rasterbar : public ConfObj @@ -8,11 +8,12 @@ class qc_libtorrent_rasterbar : public ConfObj
{
public:
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"; }
bool exec(){
QStringList incs;
QString req_ver = "0.15.0";
QString req_ver = "0.14.0";
QString adv_ver = "0.15.0";
QString version, libs, other;
VersionMode mode = VersionMin;
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
@ -21,6 +22,10 @@ public: @@ -21,6 +22,10 @@ public:
conf->addIncludePath(incs[n]);
if(!libs.isEmpty())
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;
}
};

7
src/bittorrent.cpp

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

2
src/downloadThread.cpp

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

4
src/qtorrenthandle.cpp

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

4
src/qtorrenthandle.h

@ -115,7 +115,9 @@ class QTorrentHandle { @@ -115,7 +115,9 @@ class QTorrentHandle {
qlonglong seeding_time() const;
std::vector<int> file_priorities() const;
bool is_sequential_download() const;
#ifdef LIBTORRENT_0_15
bool super_seeding() const;
#endif
QString creation_date() const;
void get_peer_info(std::vector<peer_info>&) const;
bool resolve_countries() const;
@ -144,7 +146,9 @@ class QTorrentHandle { @@ -144,7 +146,9 @@ class QTorrentHandle {
void auto_managed(bool) const;
void force_recheck() const;
void move_storage(QString path) const;
#ifdef LIBTORRENT_0_15
void super_seeding(bool on) const;
#endif
void resolve_countries(bool r);
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;

4
src/searchEngine.cpp

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

5
src/torrentAddition.h

@ -97,6 +97,9 @@ public: @@ -97,6 +97,9 @@ public:
addInPause->setChecked(true);
addInPause->setEnabled(false);
}
#ifndef LIBTORRENT_0_15
addInSeed->setEnabled(false);
#endif
}
~torrentAdditionDialog() {
@ -297,6 +300,7 @@ public slots: @@ -297,6 +300,7 @@ public slots:
settings.setValue(QString::fromUtf8("LastDirTorrentAdd"), savePathTxt->text());
// Create .incremental file if necessary
TorrentTempData::setSequential(hash, checkIncrementalDL->isChecked());
#ifdef LIBTORRENT_0_15
// Skip file checking and directly start seeding
if(addInSeed->isChecked()) {
// Check if local file(s) actually exist
@ -307,6 +311,7 @@ public slots: @@ -307,6 +311,7 @@ public slots:
return;
}
}
#endif
// Check if there is at least one selected file
if(allFiltered()){
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: @@ -99,6 +99,7 @@ public:
}
#ifdef LIBTORRENT_0_15
static void setSeedingMode(QString hash,bool seed){
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume"));
QHash<QString, QVariant> all_data = settings.value("torrents-tmp", QHash<QString, QVariant>()).toHash();
@ -116,7 +117,7 @@ public: @@ -116,7 +117,7 @@ public:
return data["seeding"].toBool();
return false;
}
#endif
static QString getSavePath(QString hash) {
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume"));

Loading…
Cancel
Save