mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-06 13:11:25 -07:00
Reallow to pause checking torrents
This commit is contained in:
parent
5d98721593
commit
64ac48ee11
1 changed files with 12 additions and 15 deletions
|
@ -1351,30 +1351,27 @@ void TorrentHandle::toggleFirstLastPiecePriority()
|
||||||
|
|
||||||
void TorrentHandle::pause()
|
void TorrentHandle::pause()
|
||||||
{
|
{
|
||||||
if (m_startupState != Started) return;
|
|
||||||
if (m_pauseWhenReady) return;
|
|
||||||
if (isChecking()) {
|
|
||||||
m_pauseWhenReady = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isPaused()) return;
|
if (isPaused()) return;
|
||||||
|
|
||||||
m_nativeHandle.auto_managed(false);
|
m_nativeHandle.auto_managed(false);
|
||||||
m_nativeHandle.pause();
|
m_nativeHandle.pause();
|
||||||
|
|
||||||
|
if (m_startupState == Started) {
|
||||||
|
if (m_pauseWhenReady) {
|
||||||
|
m_nativeHandle.stop_when_ready(false);
|
||||||
|
m_pauseWhenReady = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Libtorrent doesn't emit a torrent_paused_alert when the
|
// Libtorrent doesn't emit a torrent_paused_alert when the
|
||||||
// torrent is queued (no I/O)
|
// torrent is queued (no I/O)
|
||||||
// We test on the cached m_nativeStatus
|
// We test on the cached m_nativeStatus
|
||||||
if (isQueued())
|
if (isQueued())
|
||||||
m_session->handleTorrentPaused(this);
|
m_session->handleTorrentPaused(this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TorrentHandle::resume(bool forced)
|
void TorrentHandle::resume(bool forced)
|
||||||
{
|
{
|
||||||
if (m_startupState != Started) return;
|
|
||||||
|
|
||||||
m_pauseWhenReady = false;
|
|
||||||
resume_impl(forced);
|
resume_impl(forced);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue