Merge pull request #3494 from glassez/drop_libtorrent_0

Drop libtorrent 0.16.x support.
This commit is contained in:
sledgehammer999
2015-07-29 22:15:45 +03:00
22 changed files with 115 additions and 498 deletions

View File

@@ -98,11 +98,7 @@ void ExecutionLog::addPeerMessage(const Log::Peer& peer)
QDateTime time = QDateTime::fromMSecsSinceEpoch(peer.timestamp);
if (peer.blocked)
#if LIBTORRENT_VERSION_NUM < 10000
text = "<font color='grey'>" + time.toString(Qt::SystemLocaleShortDate) + "</font> - " + tr("<font color='red'>%1</font> was blocked", "x.y.z.w was blocked").arg(peer.ip);
#else
text = "<font color='grey'>" + time.toString(Qt::SystemLocaleShortDate) + "</font> - " + tr("<font color='red'>%1</font> was blocked %2", "x.y.z.w was blocked").arg(peer.ip).arg(peer.reason);
#endif
else
text = "<font color='grey'>" + time.toString(Qt::SystemLocaleShortDate) + "</font> - " + tr("<font color='red'>%1</font> was banned", "x.y.z.w was banned").arg(peer.ip);

View File

@@ -40,8 +40,6 @@
#include <QDesktopServices>
#include <QDebug>
#include <libtorrent/version.hpp>
#include <cstdlib>
#include "options_imp.h"
#include "core/preferences.h"
@@ -221,9 +219,7 @@ options_imp::options_imp(QWidget *parent):
connect(textProxyIP, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
connect(spinProxyPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(checkProxyPeerConnecs, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
#if LIBTORRENT_VERSION_NUM >= 10000
connect(checkForceProxy, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
#endif
connect(checkProxyAuth, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(textProxyUsername, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
connect(textProxyPassword, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
@@ -264,11 +260,6 @@ options_imp::options_imp(QWidget *parent):
scrollArea_advanced->setLayout(adv_layout);
connect(advancedSettings, SIGNAL(settingsChanged()), this, SLOT(enableApplyButton()));
//Hide incompatible options
#if LIBTORRENT_VERSION_NUM < 10000
checkForceProxy->setVisible(false);
#endif
// Adapt size
show();
loadWindowState();
@@ -436,9 +427,7 @@ void options_imp::saveOptions() {
pref->setProxyIp(getProxyIp());
pref->setProxyPort(getProxyPort());
pref->setProxyPeerConnections(checkProxyPeerConnecs->isChecked());
#if LIBTORRENT_VERSION_NUM >= 10000
pref->setForceProxy(checkForceProxy->isChecked());
#endif
pref->setProxyAuthEnabled(isProxyAuthEnabled());
pref->setProxyUsername(getProxyUsername());
pref->setProxyPassword(getProxyPassword());
@@ -691,9 +680,7 @@ void options_imp::loadOptions() {
textProxyIP->setText(pref->getProxyIp());
spinProxyPort->setValue(pref->getProxyPort());
checkProxyPeerConnecs->setChecked(pref->proxyPeerConnections());
#if LIBTORRENT_VERSION_NUM >= 10000
checkForceProxy->setChecked(pref->getForceProxy());
#endif
checkProxyAuth->setChecked(pref->isProxyAuthEnabled());
textProxyUsername->setText(pref->getProxyUsername());
textProxyPassword->setText(pref->getProxyPassword());
@@ -995,9 +982,7 @@ void options_imp::enableProxy(int index) {
lblProxyPort->setEnabled(true);
spinProxyPort->setEnabled(true);
checkProxyPeerConnecs->setEnabled(true);
#if LIBTORRENT_VERSION_NUM >= 10000
checkForceProxy->setEnabled(true);
#endif
if (index > 1) {
checkProxyAuth->setEnabled(true);
} else {
@@ -1011,9 +996,7 @@ void options_imp::enableProxy(int index) {
lblProxyPort->setEnabled(false);
spinProxyPort->setEnabled(false);
checkProxyPeerConnecs->setEnabled(false);
#if LIBTORRENT_VERSION_NUM >= 10000
checkForceProxy->setEnabled(false);
#endif
checkProxyAuth->setEnabled(false);
checkProxyAuth->setChecked(false);
}

View File

@@ -399,7 +399,6 @@ void TrackerList::editSelectedTracker() {
}
}
#if LIBTORRENT_VERSION_NUM >= 10000
void TrackerList::reannounceSelected() {
QList<QTreeWidgetItem *> selected_items = selectedItems();
if (selected_items.isEmpty()) return;
@@ -427,8 +426,6 @@ void TrackerList::reannounceSelected() {
loadTrackers();
}
#endif
void TrackerList::showTrackerListMenu(QPoint) {
BitTorrent::TorrentHandle *const torrent = properties->getCurrentTorrent();
if (!torrent) return;
@@ -444,14 +441,10 @@ void TrackerList::showTrackerListMenu(QPoint) {
copyAct = menu.addAction(GuiIconProvider::instance()->getIcon("edit-copy"), tr("Copy tracker URL"));
editAct = menu.addAction(GuiIconProvider::instance()->getIcon("edit-rename"),tr("Edit selected tracker URL"));
}
#if LIBTORRENT_VERSION_NUM >= 10000
QAction *reannounceSelAct = NULL;
#endif
QAction *reannounceAct = NULL;
if (!torrent->isPaused()) {
#if LIBTORRENT_VERSION_NUM >= 10000
reannounceSelAct = menu.addAction(GuiIconProvider::instance()->getIcon("view-refresh"), tr("Force reannounce to selected trackers"));
#endif
menu.addSeparator();
reannounceAct = menu.addAction(GuiIconProvider::instance()->getIcon("view-refresh"), tr("Force reannounce to all trackers"));
}
@@ -469,12 +462,10 @@ void TrackerList::showTrackerListMenu(QPoint) {
deleteSelectedTrackers();
return;
}
#if LIBTORRENT_VERSION_NUM >= 10000
if (act == reannounceSelAct) {
reannounceSelected();
return;
}
#endif
if (act == reannounceAct) {
BitTorrent::TorrentHandle *h = properties->getCurrentTorrent();
h->forceReannounce();

View File

@@ -36,7 +36,6 @@
#include <QList>
#include <QClipboard>
#include <libtorrent/version.hpp>
#include "propertieswidget.h"
enum TrackerListColumn {COL_TIER, COL_URL, COL_STATUS, COL_PEERS, COL_MSG};
@@ -79,9 +78,7 @@ public slots:
void loadTrackers();
void askForTrackers();
void copyTrackerUrl();
#if LIBTORRENT_VERSION_NUM >= 10000
void reannounceSelected();
#endif
void deleteSelectedTrackers();
void editSelectedTracker();
void showTrackerListMenu(QPoint);