mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Remove uneeded files on torrent deletion
Fix encoding error in file renaming
This commit is contained in:
parent
44fa7388d5
commit
a9d4b38bd3
3 changed files with 24 additions and 1 deletions
|
@ -774,7 +774,13 @@ void QBtSession::deleteTorrent(QString hash, bool delete_local_files) {
|
|||
savePathsToRemove[hash] = save_dir.absolutePath();
|
||||
s->remove_torrent(h.get_torrent_handle(), session::delete_files);
|
||||
} else {
|
||||
QStringList uneeded_files = h.uneeded_files_path();
|
||||
s->remove_torrent(h.get_torrent_handle());
|
||||
// Remove unneeded files
|
||||
foreach(const QString &uneeded_file, uneeded_files) {
|
||||
qDebug("Removing uneeded file: %s", qPrintable(uneeded_file));
|
||||
misc::safeRemove(uneeded_file);
|
||||
}
|
||||
}
|
||||
// Remove it from torrent backup directory
|
||||
QDir torrentBackup(misc::BTBackupLocation());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue