mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 19:40:18 -07:00
- Made torrent deletion from hard-drive safer
This commit is contained in:
parent
680f6409d8
commit
e82cb2188e
7 changed files with 125 additions and 140 deletions
|
@ -166,6 +166,10 @@ void bittorrent::deleteTorrent(QString hash, bool permanent) {
|
|||
}
|
||||
QString savePath = h.save_path();
|
||||
QString fileName = h.name();
|
||||
QStringList files_path;
|
||||
if(permanent){
|
||||
files_path = h.files_path();
|
||||
}
|
||||
// Remove it from session
|
||||
s->remove_torrent(h.get_torrent_handle());
|
||||
// Remove it from torrent backup directory
|
||||
|
@ -208,7 +212,7 @@ void bittorrent::deleteTorrent(QString hash, bool permanent) {
|
|||
// Remove from Hard drive
|
||||
qDebug("Removing this on hard drive: %s", qPrintable(savePath+QDir::separator()+fileName));
|
||||
// Deleting in a thread to avoid GUI freeze
|
||||
deleter->deletePath(savePath+QDir::separator()+fileName);
|
||||
deleter->deleteTorrent(savePath, files_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue