diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index efa953b20..64b86d002 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -141,6 +141,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, GUI *main_window, QBtSes connect(BTSession, SIGNAL(pausedTorrent(QTorrentHandle&)), this, SLOT(pauseTorrent(QTorrentHandle&))); connect(BTSession, SIGNAL(resumedTorrent(QTorrentHandle&)), this, SLOT(resumeTorrent(QTorrentHandle&))); connect(BTSession, SIGNAL(torrentFinishedChecking(QTorrentHandle&)), this, SLOT(updateMetadata(QTorrentHandle&))); + connect(BTSession, SIGNAL(deletedTorrent(QString)), SLOT(deleteTorrent(QString))); // Listen for list events connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(torrentDoubleClicked(QModelIndex))); @@ -256,6 +257,13 @@ void TransferListWidget::pauseTorrent(QTorrentHandle &h) { pauseTorrent(getRowFromHash(h.hash())); } +void TransferListWidget::deleteTorrent(QString hash) { + const int row = getRowFromHash(hash); + if(row >= 0) { + deleteTorrent(row, true); + } +} + void TransferListWidget::pauseTorrent(int row, bool refresh_list) { const QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(row)); listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)0.0)); diff --git a/src/transferlistwidget.h b/src/transferlistwidget.h index 16a012f2b..f554d124c 100644 --- a/src/transferlistwidget.h +++ b/src/transferlistwidget.h @@ -103,6 +103,7 @@ protected: protected slots: int updateTorrent(int row); + void deleteTorrent(QString hash); void deleteTorrent(int row, bool refresh_list=true); void pauseTorrent(int row, bool refresh_list=true); void resumeTorrent(int row, bool refresh_list=true);