mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -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(){
|
||||
|
|
|
@ -864,9 +864,10 @@ void GUI::on_actionOpen_triggered(){
|
|||
void GUI::on_actionDelete_Permanently_triggered(){
|
||||
if(tabs->currentIndex() > 1) return;
|
||||
QModelIndexList selectedIndexes;
|
||||
bool inDownloadList = true;
|
||||
bool inDownloadList;
|
||||
if(tabs->currentIndex() == 0) {
|
||||
selectedIndexes = downloadList->selectionModel()->selectedIndexes();
|
||||
inDownloadList = true;
|
||||
} else {
|
||||
selectedIndexes = finishedTorrentTab->getFinishedList()->selectionModel()->selectedIndexes();
|
||||
inDownloadList = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue