Browse Source

Don't re-announce to trackers when torrent is paused. Closes #1310.

adaptive-webui-19844
sledgehammer999 11 years ago
parent
commit
a5a0ca7159
  1. 34
      src/properties/trackerlist.cpp

34
src/properties/trackerlist.cpp

@ -140,7 +140,8 @@ void TrackerList::moveSelectionUp() { @@ -140,7 +140,8 @@ void TrackerList::moveSelectionUp() {
}
h.replace_trackers(trackers);
// Reannounce
h.force_reannounce();
if (!h.is_paused())
h.force_reannounce();
loadTrackers();
}
@ -177,7 +178,8 @@ void TrackerList::moveSelectionDown() { @@ -177,7 +178,8 @@ void TrackerList::moveSelectionDown() {
}
h.replace_trackers(trackers);
// Reannounce
h.force_reannounce();
if (!h.is_paused())
h.force_reannounce();
loadTrackers();
}
@ -302,7 +304,8 @@ void TrackerList::askForTrackers() { @@ -302,7 +304,8 @@ void TrackerList::askForTrackers() {
h.add_tracker(url);
}
// Reannounce to new trackers
h.force_reannounce();
if (!h.is_paused())
h.force_reannounce();
// Reload tracker list
loadTrackers();
}
@ -348,7 +351,8 @@ void TrackerList::deleteSelectedTrackers() { @@ -348,7 +351,8 @@ void TrackerList::deleteSelectedTrackers() {
}
}
h.replace_trackers(remaining_trackers);
h.force_reannounce();
if (!h.is_paused())
h.force_reannounce();
// Reload Trackers
loadTrackers();
}
@ -396,8 +400,10 @@ void TrackerList::editSelectedTracker() { @@ -396,8 +400,10 @@ void TrackerList::editSelectedTracker() {
}
h.replace_trackers(trackers);
h.force_reannounce();
h.force_dht_announce();
if (!h.is_paused()) {
h.force_reannounce();
h.force_dht_announce();
}
} catch(invalid_handle&) {
return;
}
@ -447,11 +453,17 @@ void TrackerList::showTrackerListMenu(QPoint) { @@ -447,11 +453,17 @@ void TrackerList::showTrackerListMenu(QPoint) {
copyAct = menu.addAction(IconProvider::instance()->getIcon("edit-copy"), tr("Copy tracker url"));
editAct = menu.addAction(IconProvider::instance()->getIcon("edit-rename"),tr("Edit selected tracker URL"));
}
#if LIBTORRENT_VERSION_MAJOR >= 1
QAction *reannounceSelAct = menu.addAction(IconProvider::instance()->getIcon("view-refresh"), tr("Force reannounce to selected trackers"));
#if LIBTORRENT_VERSION_NUM >= 10000
QAction *reannounceSelAct = NULL;
#endif
QAction *reannounceAct = NULL;
if (!h.is_paused()) {
#if LIBTORRENT_VERSION_NUM >= 10000
reannounceSelAct = menu.addAction(IconProvider::instance()->getIcon("view-refresh"), tr("Force reannounce to selected trackers"));
#endif
menu.addSeparator();
QAction *reannounceAct = menu.addAction(IconProvider::instance()->getIcon("view-refresh"), tr("Force reannounce to all trackers"));
menu.addSeparator();
reannounceAct = menu.addAction(IconProvider::instance()->getIcon("view-refresh"), tr("Force reannounce to all trackers"));
}
QAction *act = menu.exec(QCursor::pos());
if (act == 0) return;
if (act == addAct) {
@ -466,7 +478,7 @@ void TrackerList::showTrackerListMenu(QPoint) { @@ -466,7 +478,7 @@ void TrackerList::showTrackerListMenu(QPoint) {
deleteSelectedTrackers();
return;
}
#if LIBTORRENT_VERSION_MAJOR >= 1
#if LIBTORRENT_VERSION_NUM >= 10000
if (act == reannounceSelAct) {
reannounceSelected();
return;

Loading…
Cancel
Save