1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Merge pull request #10711 from Chocobo1/alert

Log performance alerts from libtorrent
This commit is contained in:
Mike Tzou 2019-05-31 10:50:03 +08:00 committed by GitHub
commit bb3634c382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 13 deletions

View File

@ -385,8 +385,9 @@ Session::Session(QObject *parent)
| lt::alert::tracker_notification
| lt::alert::status_notification
| lt::alert::ip_block_notification
| lt::alert::file_progress_notification
| lt::alert::stats_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);
lt::settings_pack pack;

View File

@ -1835,6 +1835,12 @@ void TorrentHandle::handleMetadataReceivedAlert(const lt::metadata_received_aler
}
}
void TorrentHandle::handlePerformanceAlert(const lt::performance_alert *p) const
{
LogMsg((tr("Performance alert: ") + QString::fromStdString(p->message()))
, Log::INFO);
}
void TorrentHandle::handleTempPathChanged()
{
adjustActualSavePath();
@ -1907,6 +1913,9 @@ void TorrentHandle::handleAlert(const lt::alert *a)
case lt::torrent_checked_alert::alert_type:
handleTorrentCheckedAlert(static_cast<const lt::torrent_checked_alert*>(a));
break;
case lt::performance_alert::alert_type:
handlePerformanceAlert(static_cast<const lt::performance_alert*>(a));
break;
}
}

View File

@ -360,23 +360,24 @@ namespace BitTorrent
void updateState();
void updateTorrentInfo();
void handleFastResumeRejectedAlert(const lt::fastresume_rejected_alert *p);
void handleFileCompletedAlert(const lt::file_completed_alert *p);
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 handleStatsAlert(const lt::stats_alert *p);
void handleStorageMovedAlert(const lt::storage_moved_alert *p);
void handleStorageMovedFailedAlert(const lt::storage_moved_failed_alert *p);
void handleTrackerReplyAlert(const lt::tracker_reply_alert *p);
void handleTrackerWarningAlert(const lt::tracker_warning_alert *p);
void handleTrackerErrorAlert(const lt::tracker_error_alert *p);
void handleTorrentCheckedAlert(const lt::torrent_checked_alert *p);
void handleTorrentFinishedAlert(const lt::torrent_finished_alert *p);
void handleTorrentPausedAlert(const lt::torrent_paused_alert *p);
void handleTorrentResumedAlert(const lt::torrent_resumed_alert *p);
void handleSaveResumeDataAlert(const lt::save_resume_data_alert *p);
void handleSaveResumeDataFailedAlert(const lt::save_resume_data_failed_alert *p);
void handleFastResumeRejectedAlert(const lt::fastresume_rejected_alert *p);
void handleFileRenamedAlert(const lt::file_renamed_alert *p);
void handleFileRenameFailedAlert(const lt::file_rename_failed_alert *p);
void handleFileCompletedAlert(const lt::file_completed_alert *p);
void handleMetadataReceivedAlert(const lt::metadata_received_alert *p);
void handleStatsAlert(const lt::stats_alert *p);
void handleTrackerErrorAlert(const lt::tracker_error_alert *p);
void handleTrackerReplyAlert(const lt::tracker_reply_alert *p);
void handleTrackerWarningAlert(const lt::tracker_warning_alert *p);
void resume_impl(bool forced);
bool isMoveInProgress() const;