1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-02 01:44:26 +00:00

- Make sure the torrent is not already in the list before trying to add it

This commit is contained in:
Christophe Dumez 2009-11-23 14:17:47 +00:00
parent 8650b20904
commit 68092f3b5c

View File

@ -138,6 +138,9 @@ TransferListWidget::~TransferListWidget() {
void TransferListWidget::addTorrent(QTorrentHandle& h) { void TransferListWidget::addTorrent(QTorrentHandle& h) {
if(!h.is_valid()) return; if(!h.is_valid()) return;
// Check that the torrent is not already there
if(getRowFromHash(h.hash()) >= 0) return;
// Actuall add the torrent
int row = listModel->rowCount(); int row = listModel->rowCount();
try { try {
// Adding torrent to transfer list // Adding torrent to transfer list