mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Avoid using deprecated stats_alert
From libtorrent doc: This alert has been superseded by calling post_torrent_updates() regularly on the session object.
This commit is contained in:
parent
db88c2d6a5
commit
0fe9cd05c4
3 changed files with 9 additions and 16 deletions
|
@ -386,7 +386,6 @@ Session::Session(QObject *parent)
|
|||
| lt::alert::status_notification
|
||||
| lt::alert::ip_block_notification
|
||||
| lt::alert::performance_warning
|
||||
| lt::alert::stats_notification
|
||||
| lt::alert::file_progress_notification;
|
||||
|
||||
const std::string peerId = lt::generate_fingerprint(PEER_ID, QBT_VERSION_MAJOR, QBT_VERSION_MINOR, QBT_VERSION_BUGFIX, QBT_VERSION_BUILD);
|
||||
|
@ -4280,12 +4279,15 @@ void Session::handleStateUpdateAlert(const lt::state_update_alert *p)
|
|||
{
|
||||
for (const lt::torrent_status &status : p->status) {
|
||||
TorrentHandle *const torrent = m_torrents.value(status.info_hash);
|
||||
if (torrent)
|
||||
torrent->handleStateUpdate(status);
|
||||
|
||||
if (!torrent)
|
||||
continue;
|
||||
|
||||
torrent->handleStateUpdate(status);
|
||||
}
|
||||
|
||||
m_torrentStatusReport = TorrentStatusReport();
|
||||
for (TorrentHandle *const torrent : asConst(m_torrents)) {
|
||||
for (const TorrentHandle *torrent : asConst(m_torrents)) {
|
||||
if (torrent->isDownloading())
|
||||
++m_torrentStatusReport.nbDownloading;
|
||||
if (torrent->isUploading())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue