Add sequential downloading menu items

This commit is contained in:
buinsky
2014-12-09 19:54:35 +03:00
parent 6644791458
commit 2a712a81ea
12 changed files with 149 additions and 21 deletions

View File

@@ -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();
}
}