From 5a20bdcef325c66c3c35b3f634ae7763bedbabeb Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Mon, 16 Mar 2015 23:57:03 +0200 Subject: [PATCH] Fix the deletion of torrents when using the context menu of the label sidepanel. It now uses the same logic as the code that deletes torrents when using the context menu of the transferlist. Closes #2729. --- src/gui/transferlistwidget.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index a2d01dab3..807fee7d3 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -328,16 +328,16 @@ void TransferListWidget::deleteSelectedTorrents() void TransferListWidget::deleteVisibleTorrents() { if (nameFilterModel->rowCount() <= 0) return; - QTorrentHandle torrent = BTSession->getTorrentHandle(getHashFromRow(0)); - bool delete_local_files = false; - if (Preferences::instance()->confirmTorrentDeletion() && - !DeletionConfirmationDlg::askForDeletionConfirmation(delete_local_files, nameFilterModel->rowCount(), torrent.name())) - return; QStringList hashes; for (int i = 0; irowCount(); ++i) { const int row = mapToSource(nameFilterModel->index(i, 0)).row(); hashes << getHashFromRow(row); } + QTorrentHandle torrent = BTSession->getTorrentHandle(hashes[0]); + bool delete_local_files = false; + if (Preferences::instance()->confirmTorrentDeletion() && + !DeletionConfirmationDlg::askForDeletionConfirmation(delete_local_files, hashes.size(), torrent.name())) + return; foreach (const QString &hash, hashes) BTSession->deleteTorrent(hash, delete_local_files); }