Remove uneeded files on torrent deletion

Fix encoding error in file renaming
This commit is contained in:
Christophe Dumez 2010-10-18 17:44:37 +00:00
parent 44fa7388d5
commit a9d4b38bd3
3 changed files with 24 additions and 1 deletions

View file

@ -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());