Automatically add trackers to new downloads.

This commit is contained in:
ngosang 2015-06-30 20:03:17 +02:00
parent 5cb022c7b1
commit 9c7bb08a03
6 changed files with 76 additions and 0 deletions

View file

@ -1,3 +1,4 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2015 Vladimir Golovnev <glassez@yandex.ru>
@ -620,6 +621,16 @@ void Session::configure()
qDebug("Applying encryption settings");
m_nativeSession->set_pe_settings(encryptionSettings);
// * Add trackers
m_additionalTrackers.empty();
if (pref->isAddTrackersEnabled()) {
foreach (QString tracker, pref->getTrackersList().split("\n")) {
tracker = tracker.trimmed();
if (!tracker.isEmpty())
m_additionalTrackers << tracker;
}
}
// * Maximum ratio
m_highRatioAction = pref->getMaxRatioAction();
setGlobalMaxRatio(pref->getGlobalMaxRatio());
@ -2111,6 +2122,9 @@ void Session::handleAddTorrentAlert(libtorrent::add_torrent_alert *p)
}
}
if (pref->isAddTrackersEnabled() && !torrent->isPrivate())
torrent->addTrackers(m_additionalTrackers);
bool addPaused = data.addPaused;
if (data.addPaused == TriStateBool::Undefined)
addPaused = pref->addTorrentsInPause();