mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Better on-demand reloading of torrent data
This commit is contained in:
@@ -4376,6 +4376,9 @@ void Session::handleSessionStatsAlert(const lt::session_stats_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) {
|
||||
TorrentHandle *const torrent = m_torrents.value(status.info_hash);
|
||||
|
||||
@@ -4383,6 +4386,7 @@ void Session::handleStateUpdateAlert(const lt::state_update_alert *p)
|
||||
continue;
|
||||
|
||||
torrent->handleStateUpdate(status);
|
||||
updatedTorrents.push_back(torrent);
|
||||
}
|
||||
|
||||
m_torrentStatusReport = TorrentStatusReport();
|
||||
@@ -4405,7 +4409,7 @@ void Session::handleStateUpdateAlert(const lt::state_update_alert *p)
|
||||
++m_torrentStatusReport.nbErrored;
|
||||
}
|
||||
|
||||
emit torrentsUpdated();
|
||||
emit torrentsUpdated(updatedTorrents);
|
||||
}
|
||||
|
||||
namespace
|
||||
|
||||
Reference in New Issue
Block a user