mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
Add sequential downloading menu items
This commit is contained in:
@@ -610,12 +610,7 @@ void TransferListWidget::toggleSelectedTorrentsSequentialDownload() const
|
||||
const QStringList hashes = getSelectedTorrentsHashes();
|
||||
foreach (const QString &hash, hashes) {
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||
if (h.is_valid() && h.has_metadata()) {
|
||||
bool was_sequential = h.is_sequential_download();
|
||||
h.set_sequential_download(!was_sequential);
|
||||
if (!was_sequential)
|
||||
h.prioritize_first_last_piece(true);
|
||||
}
|
||||
h.toggleSequentialDownload();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,8 +619,7 @@ void TransferListWidget::toggleSelectedFirstLastPiecePrio() const
|
||||
QStringList hashes = getSelectedTorrentsHashes();
|
||||
foreach (const QString &hash, hashes) {
|
||||
QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||
if (h.is_valid() && h.has_metadata())
|
||||
h.prioritize_first_last_piece(!h.first_last_piece_first());
|
||||
h.toggleFirstLastPiecePrio();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user