Drop support of libtorrent < 1.1.10

This commit is contained in:
Vladimir Golovnev (Glassez)
2019-01-08 15:52:12 +03:00
parent 77fc731dec
commit 302c99d7d5
22 changed files with 19 additions and 963 deletions

View File

@@ -34,7 +34,6 @@
#include <libtorrent/create_torrent.hpp>
#include <libtorrent/storage.hpp>
#include <libtorrent/torrent_info.hpp>
#include <libtorrent/version.hpp>
#include <QDirIterator>
#include <QFile>
@@ -131,13 +130,8 @@ void TorrentCreatorThread::run()
if (isInterruptionRequested()) return;
#if LIBTORRENT_VERSION_NUM < 10100
libt::create_torrent newTorrent(fs, m_params.pieceSize, -1
, (m_params.isAlignmentOptimized ? libt::create_torrent::optimize : 0));
#else
libt::create_torrent newTorrent(fs, m_params.pieceSize, -1
, (m_params.isAlignmentOptimized ? libt::create_torrent::optimize_alignment : 0));
#endif
// Add url seeds
for (QString seed : asConst(m_params.urlSeeds)) {
@@ -208,11 +202,6 @@ int TorrentCreatorThread::calculateTotalPieces(const QString &inputPath, const i
libt::file_storage fs;
libt::add_files(fs, Utils::Fs::toNativePath(inputPath).toStdString(), fileFilter);
#if LIBTORRENT_VERSION_NUM < 10100
return libt::create_torrent(fs, pieceSize, -1
, (isAlignmentOptimized ? libt::create_torrent::optimize : 0)).num_pieces();
#else
return libt::create_torrent(fs, pieceSize, -1
, (isAlignmentOptimized ? libt::create_torrent::optimize_alignment : 0)).num_pieces();
#endif
}