- Made torrent deletion from hard-drive safer

This commit is contained in:
Christophe Dumez 2007-08-23 14:04:53 +00:00
parent 680f6409d8
commit e82cb2188e
7 changed files with 125 additions and 140 deletions

View file

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