From d26e582cc185889d82d00fabbf39d54d2f02e9ec Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 7 Mar 2022 13:38:20 +0800 Subject: [PATCH] Disable performance alert The alert is too annoying and there is no control knob for tuning it, so disable it in v4_4_x branch. Closes #16462. --- src/base/bittorrent/session.cpp | 4 ---- src/base/bittorrent/torrentimpl.cpp | 9 --------- src/base/bittorrent/torrentimpl.h | 1 - 3 files changed, 14 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 5f27f4437..508b560c1 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -1069,7 +1069,6 @@ void Session::initializeNativeSession() | lt::alert::file_progress_notification | lt::alert::ip_block_notification | lt::alert::peer_notification - | lt::alert::performance_warning | lt::alert::port_mapping_notification | lt::alert::status_notification | lt::alert::storage_notification @@ -4652,9 +4651,6 @@ void Session::handleAlert(const lt::alert *a) case lt::fastresume_rejected_alert::alert_type: case lt::torrent_checked_alert::alert_type: case lt::metadata_received_alert::alert_type: - case lt::performance_alert::alert_type: - dispatchTorrentAlert(a); - break; case lt::state_update_alert::alert_type: handleStateUpdateAlert(static_cast(a)); break; diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index 3ea3326ff..f2c03abcd 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -1967,12 +1967,6 @@ void TorrentImpl::handleMetadataReceivedAlert(const lt::metadata_received_alert m_session->handleTorrentNeedSaveResumeData(this); } -void TorrentImpl::handlePerformanceAlert(const lt::performance_alert *p) const -{ - LogMsg((tr("Performance alert: ") + QString::fromStdString(p->message())) - , Log::INFO); -} - void TorrentImpl::handleCategoryOptionsChanged() { if (m_useAutoTMM) @@ -2040,9 +2034,6 @@ void TorrentImpl::handleAlert(const lt::alert *a) case lt::torrent_checked_alert::alert_type: handleTorrentCheckedAlert(static_cast(a)); break; - case lt::performance_alert::alert_type: - handlePerformanceAlert(static_cast(a)); - break; } } diff --git a/src/base/bittorrent/torrentimpl.h b/src/base/bittorrent/torrentimpl.h index d84020406..764251511 100644 --- a/src/base/bittorrent/torrentimpl.h +++ b/src/base/bittorrent/torrentimpl.h @@ -254,7 +254,6 @@ namespace BitTorrent void handleFileRenamedAlert(const lt::file_renamed_alert *p); void handleFileRenameFailedAlert(const lt::file_rename_failed_alert *p); void handleMetadataReceivedAlert(const lt::metadata_received_alert *p); - void handlePerformanceAlert(const lt::performance_alert *p) const; void handleSaveResumeDataAlert(const lt::save_resume_data_alert *p); void handleSaveResumeDataFailedAlert(const lt::save_resume_data_failed_alert *p); void handleTorrentCheckedAlert(const lt::torrent_checked_alert *p);