From ff16f59be119f9a4edd11bb6e9edc4a85f6762ec Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 18 Aug 2010 08:07:17 +0000 Subject: [PATCH] Fix per-label pause/resume actions --- src/transferlistwidget.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index 1dc000e28..4dba5b16d 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -679,12 +679,16 @@ void TransferListWidget::startAllTorrents() { } void TransferListWidget::startVisibleTorrents() { + QStringList hashes; for(int i=0; irowCount(); ++i) { const int row = mapToSource(proxyModel->index(i, 0)).row(); - QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(row)); + hashes << getHashFromRow(row); + } + foreach(const QString &hash, hashes) { + QTorrentHandle h = BTSession->getTorrentHandle(hash); if(h.is_valid() && h.is_paused()) { h.resume(); - resumeTorrent(row, false); + resumeTorrent(getRowFromHash(hash), false); } } refreshList(); @@ -715,12 +719,16 @@ void TransferListWidget::pauseAllTorrents() { } void TransferListWidget::pauseVisibleTorrents() { + QStringList hashes; for(int i=0; irowCount(); ++i) { const int row = mapToSource(proxyModel->index(i, 0)).row(); - QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(row)); + hashes << getHashFromRow(row); + } + foreach(const QString &hash, hashes) { + QTorrentHandle h = BTSession->getTorrentHandle(hash); if(h.is_valid() && !h.is_paused()) { h.pause(); - pauseTorrent(row, false); + pauseTorrent(getRowFromHash(hash), false); } } refreshList();