Skip to content

Commit

Permalink
Drop support for libtorrent v0.14.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Dumez committed Feb 18, 2012
1 parent 0c9dbc1 commit a53a707
Show file tree
Hide file tree
Showing 20 changed files with 35 additions and 260 deletions.
4 changes: 2 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ qBittorrent - A BitTorrent client in C++ / Qt4

- pkg-config executable

- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, compatible with v0.15.x/v0.16.x)
- libtorrent-rasterbar by Arvid Norberg (>= 0.15.0)
-> http:https://www.libtorrent.net
Be careful: another library (the one used by rTorrent) uses a similar name.

Expand Down Expand Up @@ -44,7 +44,7 @@ qBittorrent - A BitTorrent client in C++ / Qt4

- pkg-config executable

- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, >= v0.15.0 ADVISED)
- libtorrent-rasterbar by Arvid Norberg (>= v0.15.0)
-> http:https://www.libtorrent.net
Be careful: another library (the one used by rTorrent) uses a similar name.

Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,11 @@ class qc_libtorrent_rasterbar : public ConfObj
{
public:
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent-rasterbar >= 0.14.4"; }
QString name() const { return "libtorrent-rasterbar >= 0.15.0"; }
QString shortname() const { return "libtorrent-rasterbar"; }
bool exec(){
QStringList incs;
QString req_ver = "0.14.4";
QString req_ver = "0.15.0";
QString version, libs, other;
VersionMode mode = VersionMin;
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
Expand Down
4 changes: 2 additions & 2 deletions qcm/libtorrent-rasterbar.qcm
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class qc_libtorrent_rasterbar : public ConfObj
{
public:
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent-rasterbar >= 0.14.4"; }
QString name() const { return "libtorrent-rasterbar >= 0.15.0"; }
QString shortname() const { return "libtorrent-rasterbar"; }
bool exec(){
QStringList incs;
QString req_ver = "0.14.4";
QString req_ver = "0.15.0";
QString version, libs, other;
VersionMode mode = VersionMin;
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
Expand Down
16 changes: 1 addition & 15 deletions src/preferences/advancedsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_L
USE_ICON_THEME,
#endif
CONFIRM_DELETE_TORRENT, TRACKER_EXCHANGE,
#if LIBTORRENT_VERSION_MINOR > 14
ANNOUNCE_ALL_TRACKERS,
#endif
ROW_COUNT};

class AdvancedSettings: public QTableWidget {
Expand All @@ -41,9 +39,7 @@ class AdvancedSettings: public QTableWidget {
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
QCheckBox cb_use_icon_theme;
#endif
#if LIBTORRENT_VERSION_MINOR > 14
QCheckBox cb_announce_all_trackers;
#endif
QCheckBox cb_announce_all_trackers;
QLineEdit txt_network_address;

public:
Expand Down Expand Up @@ -85,10 +81,8 @@ public slots:
pref.resolvePeerHostNames(cb_resolve_hosts.isChecked());
// Max Half-Open connections
pref.setMaxHalfOpenConnections(spin_maxhalfopen.value());
#if LIBTORRENT_VERSION_MINOR > 14
// Super seeding
pref.enableSuperSeeding(cb_super_seeding.isChecked());
#endif
// Network interface
if(combo_iface.currentIndex() == 0) {
// All interfaces (default)
Expand Down Expand Up @@ -117,9 +111,7 @@ public slots:
pref.setConfirmTorrentDeletion(cb_confirm_torrent_deletion.isChecked());
// Tracker exchange
pref.setTrackerExchangeEnabled(cb_enable_tracker_ext.isChecked());
#if LIBTORRENT_VERSION_MINOR > 14
pref.setAnnounceToAllTrackers(cb_announce_all_trackers.isChecked());
#endif
}

signals:
Expand Down Expand Up @@ -201,11 +193,7 @@ private slots:
spin_maxhalfopen.setValue(pref.getMaxHalfOpenConnections());
setRow(MAX_HALF_OPEN, tr("Maximum number of half-open connections [0: Disabled]"), &spin_maxhalfopen);
// Super seeding
#if LIBTORRENT_VERSION_MINOR > 14
cb_super_seeding.setChecked(pref.isSuperSeedingEnabled());
#else
cb_super_seeding.setEnabled(false);
#endif
setRow(SUPER_SEEDING, tr("Strict super seeding"), &cb_super_seeding);
// Network interface
combo_iface.addItem(tr("Any interface", "i.e. Any network interface"));
Expand Down Expand Up @@ -247,11 +235,9 @@ private slots:
// Tracker exchange
cb_enable_tracker_ext.setChecked(pref.trackerExchangeEnabled());
setRow(TRACKER_EXCHANGE, tr("Exchange trackers with other peers"), &cb_enable_tracker_ext);
#if LIBTORRENT_VERSION_MINOR > 14
// Announce to all trackers
cb_announce_all_trackers.setChecked(pref.announceToAllTrackers());
setRow(ANNOUNCE_ALL_TRACKERS, tr("Always announce to all trackers"), &cb_announce_all_trackers);
#endif
}

};
Expand Down
7 changes: 0 additions & 7 deletions src/preferences/options_imp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,6 @@ options_imp::options_imp(QWidget *parent):
applyButton->setEnabled(false);
// Tab selection mecanism
connect(tabSelection, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*)));
#if LIBTORRENT_VERSION_MINOR < 15
checkAppendqB->setVisible(false);
#endif
#if LIBTORRENT_VERSION_MINOR < 16
checkuTP->setVisible(false);
checkLimituTPConnections->setVisible(false);
Expand Down Expand Up @@ -392,9 +389,7 @@ void options_imp::saveOptions(){
#endif
pref.setTempPath(temp_path);
pref.setAppendTorrentLabel(checkAppendLabel->isChecked());
#if LIBTORRENT_VERSION_MINOR > 14
pref.useIncompleteFilesExtension(checkAppendqB->isChecked());
#endif
pref.preAllocateAllFiles(preAllocateAllFiles());
pref.useAdditionDialog(useAdditionDialog());
pref.addTorrentsInPause(addTorrentsInPause());
Expand Down Expand Up @@ -569,9 +564,7 @@ void options_imp::loadOptions(){
#endif
textTempPath->setText(temp_path);
checkAppendLabel->setChecked(pref.appendTorrentLabel());
#if LIBTORRENT_VERSION_MINOR > 14
checkAppendqB->setChecked(pref.useIncompleteFilesExtension());
#endif
checkPreallocateAll->setChecked(pref.preAllocateAllFiles());
checkAdditionDialog->setChecked(pref.useAdditionDialog());
checkStartPaused->setChecked(pref.addTorrentsInPause());
Expand Down
4 changes: 0 additions & 4 deletions src/preferences/preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,13 @@ class Preferences : public QIniSettings {
setValue(QString::fromUtf8("Preferences/Downloads/TempPath"), path);
}

#if LIBTORRENT_VERSION_MINOR > 14
bool useIncompleteFilesExtension() const {
return value(QString::fromUtf8("Preferences/Downloads/UseIncompleteExtension"), false).toBool();
}

void useIncompleteFilesExtension(bool enabled) {
setValue(QString::fromUtf8("Preferences/Downloads/UseIncompleteExtension"), enabled);
}
#endif

bool appendTorrentLabel() const {
return value(QString::fromUtf8("Preferences/Downloads/AppendLabel"), false).toBool();
Expand Down Expand Up @@ -1025,7 +1023,6 @@ class Preferences : public QIniSettings {
}
#endif

#if LIBTORRENT_VERSION_MINOR > 14
bool isSuperSeedingEnabled() const {
return value(QString::fromUtf8("Preferences/Advanced/SuperSeeding"), false).toBool();
}
Expand All @@ -1041,7 +1038,6 @@ class Preferences : public QIniSettings {
void setAnnounceToAllTrackers(bool enabled) {
setValue(QString::fromUtf8("Preferences/Advanced/AnnounceToAllTrackers"), enabled);
}
#endif

#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
bool useSystemIconTheme() const {
Expand Down
3 changes: 1 addition & 2 deletions src/previewselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ void PreviewSelect::on_previewButton_clicked(){
QModelIndex index;
QModelIndexList selectedIndexes = previewList->selectionModel()->selectedRows(NAME);
if(selectedIndexes.size() == 0) return;
#if LIBTORRENT_VERSION_MINOR > 14
// Flush data
h.flush_cache();
#endif

QString path;
foreach(index, selectedIndexes){
path = h.absolute_files_path().at(indexes.at(index.row()));
Expand Down
4 changes: 0 additions & 4 deletions src/properties/propertieswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,8 @@ void PropertiesWidget::openDoubleClickedFile(QModelIndex index) {
const QString filename = h.filepath_at(i);
const QString file_path = QDir::cleanPath(saveDir.absoluteFilePath(filename));
qDebug("Trying to open file at %s", qPrintable(file_path));
#if LIBTORRENT_VERSION_MINOR > 14
// Flush data
h.flush_cache();
#endif
if(QFile::exists(file_path)) {
QDesktopServices::openUrl(QUrl::fromLocalFile(file_path));
} else {
Expand All @@ -442,10 +440,8 @@ void PropertiesWidget::openDoubleClickedFile(QModelIndex index) {
const QString filename = path_items.join(QDir::separator());
const QString file_path = QDir::cleanPath(saveDir.absoluteFilePath(filename));
qDebug("Trying to open folder at %s", qPrintable(file_path));
#if LIBTORRENT_VERSION_MINOR > 14
// Flush data
h.flush_cache();
#endif
if(QFile::exists(file_path)) {
QDesktopServices::openUrl(QUrl::fromLocalFile(file_path));
} else {
Expand Down
15 changes: 0 additions & 15 deletions src/properties/trackerlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ void TrackerList::loadTrackers() {
}
TrackerInfos data = trackers_data.value(tracker_url, TrackerInfos(tracker_url));
QString error_message = data.last_message.trimmed();
#if LIBTORRENT_VERSION_MINOR > 14
if(it->verified) {
item->setText(COL_STATUS, tr("Working"));
item->setText(COL_MSG, "");
Expand All @@ -265,20 +264,6 @@ void TrackerList::loadTrackers() {
}
}
}
#else
if(data.verified) {
item->setText(COL_STATUS, tr("Working"));
item->setText(COL_MSG, "");
} else {
if(data.fail_count > 0) {
item->setText(COL_STATUS, tr("Not working"));
item->setText(COL_MSG, error_message);
} else {
item->setText(COL_STATUS, tr("Not contacted yet"));
item->setText(COL_MSG, "");
}
}
#endif
item->setText(COL_PEERS, QString::number(trackers_data.value(tracker_url, TrackerInfos(tracker_url)).num_peers));
}
// Remove old trackers
Expand Down
Loading

0 comments on commit a53a707

Please sign in to comment.