mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-24 10:16:00 +03:00
parent
c02f80cec5
commit
b462a2bf0c
1 changed files with 21 additions and 6 deletions
|
@ -4072,14 +4072,29 @@ bool SessionImpl::isPaused() const
|
||||||
|
|
||||||
void SessionImpl::pause()
|
void SessionImpl::pause()
|
||||||
{
|
{
|
||||||
if (!m_isPaused)
|
if (m_isPaused)
|
||||||
{
|
return;
|
||||||
if (isRestored())
|
|
||||||
m_nativeSession->pause();
|
|
||||||
|
|
||||||
m_isPaused = true;
|
if (isRestored())
|
||||||
emit paused();
|
{
|
||||||
|
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()
|
void SessionImpl::resume()
|
||||||
|
|
Loading…
Reference in a new issue