From 9dadb919ef0e108ada51ed8e16be6edbb4bd77e4 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Sun, 23 Sep 2018 12:29:50 +0300 Subject: [PATCH] Improve force recheck of paused torrent --- src/base/bittorrent/torrenthandle.cpp | 10 +--------- src/base/bittorrent/torrenthandle.h | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index 040ea0f91..0e7142004 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -191,7 +191,6 @@ TorrentHandle::TorrentHandle(Session *session, const libtorrent::torrent_handle , m_hasRootFolder(params.hasRootFolder) , m_needsToSetFirstLastPiecePriority(false) , m_needsToStartForced(params.forced) - , m_pauseAfterRecheck(false) { if (m_useAutoTMM) m_savePath = Utils::Fs::toNativePath(m_session->categorySavePath(m_category)); @@ -1275,11 +1274,9 @@ void TorrentHandle::forceRecheck() m_unchecked = false; if (isPaused()) { - m_pauseAfterRecheck = true; + m_nativeHandle.stop_when_ready(true); resume_impl(true, true); } - - m_nativeHandle.force_recheck(); } void TorrentHandle::setSequentialDownload(bool b) @@ -1587,11 +1584,6 @@ void TorrentHandle::handleTorrentCheckedAlert(const libtorrent::torrent_checked_ adjustActualSavePath(); manageIncompleteFiles(); - - if (m_pauseAfterRecheck) { - m_pauseAfterRecheck = false; - pause(); - } } m_session->handleTorrentChecked(this); diff --git a/src/base/bittorrent/torrenthandle.h b/src/base/bittorrent/torrenthandle.h index 75cff5d6f..882444c1a 100644 --- a/src/base/bittorrent/torrenthandle.h +++ b/src/base/bittorrent/torrenthandle.h @@ -463,7 +463,6 @@ namespace BitTorrent bool m_needsToSetFirstLastPiecePriority; bool m_needsToStartForced; - bool m_pauseAfterRecheck; QHash m_trackerInfos; enum StartupState