1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 14:57:52 +00:00

- Added some checking before adding torrents to finished/download lists to avoid duplicate in some circumstances

This commit is contained in:
Christophe Dumez 2007-08-19 16:50:05 +00:00
parent a01c7e2c60
commit a4a98e3ada
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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()));