mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
commit
4d92c7e094
2 changed files with 4 additions and 5 deletions
|
@ -508,7 +508,6 @@ Session::Session(QObject *parent)
|
||||||
new PortForwarderImpl {m_nativeSession};
|
new PortForwarderImpl {m_nativeSession};
|
||||||
|
|
||||||
initMetrics();
|
initMetrics();
|
||||||
m_statsUpdateTimer.start();
|
|
||||||
|
|
||||||
qDebug("* BitTorrent Session constructed");
|
qDebug("* BitTorrent Session constructed");
|
||||||
}
|
}
|
||||||
|
@ -3788,7 +3787,6 @@ void Session::handleAlert(const lt::alert *a)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
switch (a->type()) {
|
switch (a->type()) {
|
||||||
case lt::stats_alert::alert_type:
|
|
||||||
case lt::file_renamed_alert::alert_type:
|
case lt::file_renamed_alert::alert_type:
|
||||||
case lt::file_completed_alert::alert_type:
|
case lt::file_completed_alert::alert_type:
|
||||||
case lt::torrent_finished_alert::alert_type:
|
case lt::torrent_finished_alert::alert_type:
|
||||||
|
@ -4207,7 +4205,9 @@ void Session::handleExternalIPAlert(const lt::external_ip_alert *p)
|
||||||
|
|
||||||
void Session::handleSessionStatsAlert(const lt::session_stats_alert *p)
|
void Session::handleSessionStatsAlert(const lt::session_stats_alert *p)
|
||||||
{
|
{
|
||||||
const qreal interval = m_statsUpdateTimer.restart() / 1000.;
|
const qreal interval = lt::total_milliseconds(p->timestamp() - m_statsLastTimestamp) / 1000.;
|
||||||
|
m_statsLastTimestamp = p->timestamp();
|
||||||
|
|
||||||
#if (LIBTORRENT_VERSION_NUM < 10200)
|
#if (LIBTORRENT_VERSION_NUM < 10200)
|
||||||
const auto &stats = p->values;
|
const auto &stats = p->values;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
|
|
||||||
#include <libtorrent/fwd.hpp>
|
#include <libtorrent/fwd.hpp>
|
||||||
|
|
||||||
#include <QElapsedTimer>
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
@ -701,7 +700,7 @@ namespace BitTorrent
|
||||||
QTimer *m_recentErroredTorrentsTimer;
|
QTimer *m_recentErroredTorrentsTimer;
|
||||||
|
|
||||||
SessionMetricIndices m_metricIndices;
|
SessionMetricIndices m_metricIndices;
|
||||||
QElapsedTimer m_statsUpdateTimer;
|
lt::time_point m_statsLastTimestamp = lt::clock_type::now();
|
||||||
|
|
||||||
SessionStatus m_status;
|
SessionStatus m_status;
|
||||||
CacheStatus m_cacheStatus;
|
CacheStatus m_cacheStatus;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue