|
|
@ -394,22 +394,28 @@ void TrackerList::editSelectedTracker() { |
|
|
|
torrent->replaceTrackers(trackers); |
|
|
|
torrent->replaceTrackers(trackers); |
|
|
|
if (!torrent->isPaused()) { |
|
|
|
if (!torrent->isPaused()) { |
|
|
|
torrent->forceReannounce(); |
|
|
|
torrent->forceReannounce(); |
|
|
|
torrent->forceDHTAnnounce(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if LIBTORRENT_VERSION_NUM >= 10000 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 10000 |
|
|
|
void TrackerList::reannounceSelected() { |
|
|
|
void TrackerList::reannounceSelected() { |
|
|
|
|
|
|
|
QList<QTreeWidgetItem *> selected_items = selectedItems(); |
|
|
|
|
|
|
|
if (selected_items.isEmpty()) return; |
|
|
|
|
|
|
|
|
|
|
|
BitTorrent::TorrentHandle *const torrent = properties->getCurrentTorrent(); |
|
|
|
BitTorrent::TorrentHandle *const torrent = properties->getCurrentTorrent(); |
|
|
|
if (!torrent) return; |
|
|
|
if (!torrent) return; |
|
|
|
|
|
|
|
QList<BitTorrent::TrackerEntry> trackers = torrent->trackers(); |
|
|
|
|
|
|
|
|
|
|
|
QList<QTreeWidgetItem *> selected_items = getSelectedTrackerItems(); |
|
|
|
foreach (QTreeWidgetItem* item, selected_items) { |
|
|
|
if (selected_items.isEmpty()) return; |
|
|
|
// DHT case
|
|
|
|
|
|
|
|
if (item == dht_item) { |
|
|
|
|
|
|
|
torrent->forceDHTAnnounce(); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QList<BitTorrent::TrackerEntry> trackers = torrent->trackers(); |
|
|
|
// Trackers case
|
|
|
|
for (int i = 0; i < trackers.size(); ++i) { |
|
|
|
for (int i = 0; i < trackers.size(); ++i) { |
|
|
|
foreach (QTreeWidgetItem* w, selected_items) { |
|
|
|
if (item->text(COL_URL) == trackers[i].url()) { |
|
|
|
if (w->text(COL_URL) == trackers[i].url()) { |
|
|
|
|
|
|
|
torrent->forceReannounce(i); |
|
|
|
torrent->forceReannounce(i); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -468,7 +474,9 @@ void TrackerList::showTrackerListMenu(QPoint) { |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
if (act == reannounceAct) { |
|
|
|
if (act == reannounceAct) { |
|
|
|
properties->getCurrentTorrent()->forceReannounce(); |
|
|
|
BitTorrent::TorrentHandle *h = properties->getCurrentTorrent(); |
|
|
|
|
|
|
|
h->forceReannounce(); |
|
|
|
|
|
|
|
h->forceDHTAnnounce(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (act == editAct) { |
|
|
|
if (act == editAct) { |
|
|
|