mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 17:23:07 -07:00
Merge pull request #3332 from ngosang/addtrackers2
Automatically add trackers to new downloads. Closes #262
This commit is contained in:
commit
66ce5c2557
6 changed files with 76 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2015 Vladimir Golovnev <glassez@yandex.ru>
|
||||
|
@ -619,6 +620,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());
|
||||
|
@ -2153,6 +2164,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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue