mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
committed by
GitHub
parent
c02f80cec5
commit
b462a2bf0c
@@ -4072,14 +4072,29 @@ bool SessionImpl::isPaused() const
|
||||
|
||||
void SessionImpl::pause()
|
||||
{
|
||||
if (!m_isPaused)
|
||||
{
|
||||
if (m_isPaused)
|
||||
return;
|
||||
|
||||
if (isRestored())
|
||||
{
|
||||
m_nativeSession->pause();
|
||||
|
||||
for (TorrentImpl *torrent : asConst(m_torrents))
|
||||
{
|
||||
torrent->resetTrackerEntryStatuses();
|
||||
|
||||
const QList<TrackerEntryStatus> trackers = torrent->trackers();
|
||||
QHash<QString, TrackerEntryStatus> updatedTrackers;
|
||||
updatedTrackers.reserve(trackers.size());
|
||||
|
||||
for (const TrackerEntryStatus &status : trackers)
|
||||
updatedTrackers.emplace(status.url, status);
|
||||
emit trackerEntryStatusesUpdated(torrent, updatedTrackers);
|
||||
}
|
||||
}
|
||||
|
||||
m_isPaused = true;
|
||||
emit paused();
|
||||
}
|
||||
}
|
||||
|
||||
void SessionImpl::resume()
|
||||
|
||||
Reference in New Issue
Block a user