From bf6d7534d562b9e8ae00994b01213c2ba7f564d8 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 17 Nov 2009 13:16:25 +0000 Subject: [PATCH] - upload speed limiting now works for seeding torrents --- src/TransferListWidget.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/TransferListWidget.cpp b/src/TransferListWidget.cpp index 9c186d0fc..a4f66776b 100644 --- a/src/TransferListWidget.cpp +++ b/src/TransferListWidget.cpp @@ -587,8 +587,7 @@ void TransferListWidget::setDlLimitSelectedTorrents() { if(ok) { foreach(QTorrentHandle h, selected_torrents) { qDebug("Applying download speed limit of %ld Kb/s to torrent %s", (long)(new_limit/1024.), h.hash().toLocal8Bit().data()); - h.set_download_limit(new_limit); - TorrentPersistentData::saveSpeedLimits(h); + BTSession->setDownloadLimit(h.hash(), new_limit); } } } @@ -603,7 +602,7 @@ void TransferListWidget::setUpLimitSelectedTorrents() { // Get the file hash QString hash = getHashFromRow(proxyModel->mapToSource(index).row()); QTorrentHandle h = BTSession->getTorrentHandle(hash); - if(h.is_valid() && !h.is_seed()) { + if(h.is_valid()) { selected_torrents << h; // Determine current limit for selected torrents if(first) { @@ -624,8 +623,7 @@ void TransferListWidget::setUpLimitSelectedTorrents() { if(ok) { foreach(QTorrentHandle h, selected_torrents) { qDebug("Applying upload speed limit of %ld Kb/s to torrent %s", (long)(new_limit/1024.), h.hash().toLocal8Bit().data()); - h.set_upload_limit(new_limit); - TorrentPersistentData::saveSpeedLimits(h); + BTSession->setUploadLimit(h.hash(), new_limit); } } }