|
|
@ -516,7 +516,6 @@ Session::Session(QObject *parent) |
|
|
|
, m_OSMemoryPriority(BITTORRENT_KEY("OSMemoryPriority"), OSMemoryPriority::BelowNormal) |
|
|
|
, m_OSMemoryPriority(BITTORRENT_KEY("OSMemoryPriority"), OSMemoryPriority::BelowNormal) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
, m_resumeFolderLock {new QFile {this}} |
|
|
|
, m_resumeFolderLock {new QFile {this}} |
|
|
|
, m_refreshTimer {new QTimer {this}} |
|
|
|
|
|
|
|
, m_seedingLimitTimer {new QTimer {this}} |
|
|
|
, m_seedingLimitTimer {new QTimer {this}} |
|
|
|
, m_resumeDataTimer {new QTimer {this}} |
|
|
|
, m_resumeDataTimer {new QTimer {this}} |
|
|
|
, m_statistics {new Statistics {this}} |
|
|
|
, m_statistics {new Statistics {this}} |
|
|
@ -552,10 +551,7 @@ Session::Session(QObject *parent) |
|
|
|
|
|
|
|
|
|
|
|
m_tags = List::toSet(m_storedTags.value()); |
|
|
|
m_tags = List::toSet(m_storedTags.value()); |
|
|
|
|
|
|
|
|
|
|
|
m_refreshTimer->setInterval(refreshInterval()); |
|
|
|
enqueueRefresh(); |
|
|
|
connect(m_refreshTimer, &QTimer::timeout, this, &Session::refresh); |
|
|
|
|
|
|
|
m_refreshTimer->start(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateSeedingLimitTimer(); |
|
|
|
updateSeedingLimitTimer(); |
|
|
|
populateAdditionalTrackers(); |
|
|
|
populateAdditionalTrackers(); |
|
|
|
|
|
|
|
|
|
|
@ -669,7 +665,6 @@ uint Session::refreshInterval() const |
|
|
|
void Session::setRefreshInterval(const uint value) |
|
|
|
void Session::setRefreshInterval(const uint value) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (value != refreshInterval()) { |
|
|
|
if (value != refreshInterval()) { |
|
|
|
m_refreshTimer->setInterval(value); |
|
|
|
|
|
|
|
m_refreshInterval = value; |
|
|
|
m_refreshInterval = value; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -4127,10 +4122,17 @@ quint64 Session::getAlltimeUL() const |
|
|
|
return m_statistics->getAlltimeUL(); |
|
|
|
return m_statistics->getAlltimeUL(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Session::refresh() |
|
|
|
void Session::enqueueRefresh() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Q_ASSERT(!m_refreshEnqueued); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTimer::singleShot(refreshInterval(), this, [this] () |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_nativeSession->post_torrent_updates(); |
|
|
|
m_nativeSession->post_torrent_updates(); |
|
|
|
m_nativeSession->post_session_stats(); |
|
|
|
m_nativeSession->post_session_stats(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_refreshEnqueued = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Session::handleIPFilterParsed(const int ruleCount) |
|
|
|
void Session::handleIPFilterParsed(const int ruleCount) |
|
|
@ -4666,6 +4668,11 @@ void Session::handleSessionStatsAlert(const lt::session_stats_alert *p) |
|
|
|
? (stats[m_metricIndices.disk.diskJobTime] / totalJobs) : 0; |
|
|
|
? (stats[m_metricIndices.disk.diskJobTime] / totalJobs) : 0; |
|
|
|
|
|
|
|
|
|
|
|
emit statsUpdated(); |
|
|
|
emit statsUpdated(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_refreshEnqueued) |
|
|
|
|
|
|
|
m_refreshEnqueued = false; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
enqueueRefresh(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Session::handleAlertsDroppedAlert(const lt::alerts_dropped_alert *p) const |
|
|
|
void Session::handleAlertsDroppedAlert(const lt::alerts_dropped_alert *p) const |
|
|
@ -4712,6 +4719,11 @@ void Session::handleStateUpdateAlert(const lt::state_update_alert *p) |
|
|
|
|
|
|
|
|
|
|
|
if (!updatedTorrents.isEmpty()) |
|
|
|
if (!updatedTorrents.isEmpty()) |
|
|
|
emit torrentsUpdated(updatedTorrents); |
|
|
|
emit torrentsUpdated(updatedTorrents); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_refreshEnqueued) |
|
|
|
|
|
|
|
m_refreshEnqueued = false; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
enqueueRefresh(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if (LIBTORRENT_VERSION_NUM >= 10204) |
|
|
|
#if (LIBTORRENT_VERSION_NUM >= 10204) |
|
|
|