Drop libtorrent 0.15.x support.

This commit is contained in:
sledgehammer999
2013-10-23 22:16:23 +03:00
parent 243abaf524
commit b4dca951b2
23 changed files with 19 additions and 518 deletions

View File

@@ -238,12 +238,10 @@ void PeerListWidget::limitUpRateSelectedPeers(const QStringList& peer_ips)
bool ok = false;
int cur_limit = -1;
#if LIBTORRENT_VERSION_NUM >= 001600
boost::asio::ip::tcp::endpoint first_ep = m_peerEndpoints.value(peer_ips.first(),
boost::asio::ip::tcp::endpoint());
if (first_ep != boost::asio::ip::tcp::endpoint())
cur_limit = h.get_peer_upload_limit(first_ep);
#endif
long limit = SpeedLimitDialog::askSpeedLimit(&ok,
tr("Upload rate limiting"),
cur_limit,
@@ -273,12 +271,10 @@ void PeerListWidget::limitDlRateSelectedPeers(const QStringList& peer_ips)
return;
bool ok = false;
int cur_limit = -1;
#if LIBTORRENT_VERSION_NUM >= 001600
boost::asio::ip::tcp::endpoint first_ep = m_peerEndpoints.value(peer_ips.first(),
boost::asio::ip::tcp::endpoint());
if (first_ep != boost::asio::ip::tcp::endpoint())
cur_limit = h.get_peer_download_limit(first_ep);
#endif
long limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Download rate limiting"), cur_limit, Preferences().getGlobalDownloadLimit()*1024.);
if (!ok)
return;
@@ -435,12 +431,10 @@ QString PeerListWidget::getConnectionString(int connection_type)
{
QString connection;
switch(connection_type) {
#if LIBTORRENT_VERSION_NUM >= 001600
case peer_info::bittorrent_utp:
connection = "uTP";
break;
case peer_info::http_seed:
#endif
case peer_info::web_seed:
connection = "Web";
break;
@@ -506,11 +500,9 @@ QString PeerListWidget::getFlags(const peer_info& peer)
if (peer.flags & peer_info::plaintext_encrypted)
flags += "e ";
#if LIBTORRENT_VERSION_NUM > 001500
//P = Peer is using uTorrent uTP
if (peer.connection_type & peer_info::bittorrent_utp)
flags += "P ";
#endif
//L = Peer is local
if (peer.source & peer_info::lsd)

View File

@@ -453,11 +453,7 @@ void PropertiesWidget::displayFilesListMenu(const QPoint&) {
myFilesLlistMenu.addSeparator();
}
QMenu subMenu;
#if LIBTORRENT_VERSION_NUM >= 001600
if (!h.status(0x0).is_seeding) {
#else
if (!static_cast<torrent_handle>(h).is_seed()) {
#endif
subMenu.setTitle(tr("Priority"));
subMenu.addAction(actionNot_downloaded);
subMenu.addAction(actionNormal);

View File

@@ -159,11 +159,8 @@ public:
if (index.column() != PRIORITY) return 0;
if (properties) {
QTorrentHandle h = properties->getCurrentTorrent();
#if LIBTORRENT_VERSION_NUM >= 001600
if (!h.is_valid() || !h.has_metadata() || h.status(0x0).is_seeding) return 0;
#else
if (!h.is_valid() || !h.has_metadata() || static_cast<libtorrent::torrent_handle>(h).is_seed()) return 0;
#endif
if (!h.is_valid() || !h.has_metadata() || h.status(0x0).is_seeding)
return 0;
}
if (index.data().toInt() <= 0) {
// IGNORED or MIXED