mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06:00
Remove uneeded files on torrent deletion
Fix encoding error in file renaming
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user