mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- fixed delete permanently in finished list
This commit is contained in:
parent
68b867e480
commit
5e73539393
4 changed files with 19 additions and 18 deletions
|
@ -279,16 +279,15 @@ int FinishedTorrents::getRowFromHash(const QString& hash) const{
|
|||
|
||||
// Will move it to download tab
|
||||
void FinishedTorrents::deleteFromFinishedList(QString hash){
|
||||
finishedSHAs.removeAll(hash);
|
||||
QList<QStandardItem *> items = finishedListModel->findItems(hash, Qt::MatchExactly, HASH );
|
||||
if(items.size() != 1){
|
||||
qDebug("Problem: Can't delete torrent from finished list");
|
||||
return;
|
||||
int row = getRowFromHash(hash);
|
||||
if(row == -1){
|
||||
std::cerr << "Error: couldn't find hash in finished list\n";
|
||||
}
|
||||
finishedListModel->removeRow(finishedListModel->indexFromItem(items.at(0)).row());
|
||||
finishedListModel->removeRow(row);
|
||||
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".finished");
|
||||
--nbFinished;
|
||||
((GUI*)parent)->setTabText(1, tr("Finished") +" ("+QString(misc::toString(nbFinished).c_str())+")");
|
||||
finishedSHAs.removeAll(hash);
|
||||
}
|
||||
|
||||
QTreeView* FinishedTorrents::getFinishedList(){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue