From 2707bf63491fc0956cdcd7f2d921a09c8a08148b Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 22 Nov 2010 18:43:52 +0000 Subject: [PATCH] FEATURE: Download first/last pieces first when sequential download is enabled (Thanks Ahmad) --- Changelog | 2 ++ src/transferlistwidget.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index e40420113..51f581289 100644 --- a/Changelog +++ b/Changelog @@ -12,6 +12,8 @@ - FEATURE: Added "Amount downloaded/left" columns to transfer list - FEATURE: Simplified proxy settings - FEATURE: Optimized and improved the peer country resolution code + - FEATURE: Download first/last pieces first when sequential download is + enabled (Thanks Ahmad) - BUGFIX: Fix SOCKS5 proxy authentication in search engine(closes #680072) - COSMETIC: Replaced message box by on-screen notification for download errors - COSMETIC: Improved the torrent creation tool appearance diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index 7b62d4cbc..62c317d09 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -562,7 +562,10 @@ void TransferListWidget::toggleSelectedTorrentsSequentialDownload() const { foreach(const QString &hash, hashes) { QTorrentHandle h = BTSession->getTorrentHandle(hash); if(h.is_valid() && h.has_metadata()) { - h.set_sequential_download(!h.is_sequential_download()); + bool was_sequential = h.is_sequential_download(); + h.set_sequential_download(!was_sequential); + if(!was_sequential) + h.prioritize_first_last_piece(true); } } }