mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
- Added some checking before adding torrents to finished/download lists to avoid duplicate in some circumstances
This commit is contained in:
@@ -75,7 +75,9 @@ FinishedTorrents::~FinishedTorrents(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FinishedTorrents::addFinishedTorrent(QString hash){
|
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);
|
torrent_handle h = BTSession->getTorrentHandle(hash);
|
||||||
// Adding torrent to download list
|
// Adding torrent to download list
|
||||||
finishedListModel->insertRow(row);
|
finishedListModel->insertRow(row);
|
||||||
|
|||||||
@@ -633,8 +633,10 @@ unsigned int GUI::getCurrentTabIndex() const{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GUI::restoreInDownloadList(torrent_handle h){
|
void GUI::restoreInDownloadList(torrent_handle h){
|
||||||
unsigned int row = DLListModel->rowCount();
|
|
||||||
QString hash = QString(misc::toString(h.info_hash()).c_str());
|
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
|
// Adding torrent to download list
|
||||||
DLListModel->insertRow(row);
|
DLListModel->insertRow(row);
|
||||||
DLListModel->setData(DLListModel->index(row, NAME), QVariant(h.name().c_str()));
|
DLListModel->setData(DLListModel->index(row, NAME), QVariant(h.name().c_str()));
|
||||||
|
|||||||
Reference in New Issue
Block a user