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:
parent
a01c7e2c60
commit
a4a98e3ada
@ -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);
|
||||
|
@ -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()));
|
||||
|
Loading…
Reference in New Issue
Block a user