diff --git a/src/FinishedTorrents.cpp b/src/FinishedTorrents.cpp index 81a955468..e9f48e743 100644 --- a/src/FinishedTorrents.cpp +++ b/src/FinishedTorrents.cpp @@ -75,7 +75,9 @@ FinishedTorrents::~FinishedTorrents(){ } void FinishedTorrents::addFinishedTorrent(QString hash){ - int row = finishedListModel->rowCount(); + int row = getRowFromHash(hash); + if(row != -1) return; + row = finishedListModel->rowCount(); torrent_handle h = BTSession->getTorrentHandle(hash); // Adding torrent to download list finishedListModel->insertRow(row); diff --git a/src/GUI.cpp b/src/GUI.cpp index 209f5cbd8..43c1432dd 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -633,8 +633,10 @@ unsigned int GUI::getCurrentTabIndex() const{ } void GUI::restoreInDownloadList(torrent_handle h){ - unsigned int row = DLListModel->rowCount(); QString hash = QString(misc::toString(h.info_hash()).c_str()); + int row = getRowFromHash(hash); + if(row != -1) return; + row = DLListModel->rowCount(); // Adding torrent to download list DLListModel->insertRow(row); DLListModel->setData(DLListModel->index(row, NAME), QVariant(h.name().c_str()));