From 282d0a4af61bbb8c406fb2e9ccda19274930fcec Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 3 Jan 2009 20:06:46 +0000 Subject: [PATCH] - Save fastresume fata when pausing torrents to speed up qBittorrent shutdown --- src/bittorrent.cpp | 2 +- src/qtorrenthandle.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index f74afa16b..dcff27616 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -787,7 +787,7 @@ void bittorrent::saveFastResumeData() { std::vector::iterator torrentIT; for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) { QTorrentHandle h = QTorrentHandle(*torrentIT); - if(!h.is_valid() || !h.has_metadata()) continue; + if(!h.is_valid() || !h.has_metadata() || h.is_paused()) continue; if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) continue; h.save_resume_data(); ++num_resume_data; diff --git a/src/qtorrenthandle.cpp b/src/qtorrenthandle.cpp index b3044105c..fba68471d 100644 --- a/src/qtorrenthandle.cpp +++ b/src/qtorrenthandle.cpp @@ -319,6 +319,7 @@ void QTorrentHandle::pause() { Q_ASSERT(h.is_valid()); h.auto_managed(false); h.pause(); + h.save_resume_data(); } void QTorrentHandle::resume() {