mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 09:13:08 -07:00
Better on-demand reloading of torrent data
This commit is contained in:
parent
d639c16f72
commit
1f3bf75fff
4 changed files with 18 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue