mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-21 16:55:46 +03:00
parent
c02f80cec5
commit
b462a2bf0c
1 changed files with 21 additions and 6 deletions
|
@ -4072,15 +4072,30 @@ 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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue