|
|
@ -4376,6 +4376,9 @@ void Session::handleSessionStatsAlert(const lt::session_stats_alert *p) |
|
|
|
|
|
|
|
|
|
|
|
void Session::handleStateUpdateAlert(const lt::state_update_alert *p) |
|
|
|
void Session::handleStateUpdateAlert(const lt::state_update_alert *p) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
QVector<BitTorrent::TorrentHandle *> updatedTorrents; |
|
|
|
|
|
|
|
updatedTorrents.reserve(p->status.size()); |
|
|
|
|
|
|
|
|
|
|
|
for (const lt::torrent_status &status : p->status) { |
|
|
|
for (const lt::torrent_status &status : p->status) { |
|
|
|
TorrentHandle *const torrent = m_torrents.value(status.info_hash); |
|
|
|
TorrentHandle *const torrent = m_torrents.value(status.info_hash); |
|
|
|
|
|
|
|
|
|
|
@ -4383,6 +4386,7 @@ void Session::handleStateUpdateAlert(const lt::state_update_alert *p) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
torrent->handleStateUpdate(status); |
|
|
|
torrent->handleStateUpdate(status); |
|
|
|
|
|
|
|
updatedTorrents.push_back(torrent); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
m_torrentStatusReport = TorrentStatusReport(); |
|
|
|
m_torrentStatusReport = TorrentStatusReport(); |
|
|
@ -4405,7 +4409,7 @@ void Session::handleStateUpdateAlert(const lt::state_update_alert *p) |
|
|
|
++m_torrentStatusReport.nbErrored; |
|
|
|
++m_torrentStatusReport.nbErrored; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
emit torrentsUpdated(); |
|
|
|
emit torrentsUpdated(updatedTorrents); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
namespace |
|
|
|
namespace |
|
|
|