Torrent addition dialog size/pos are now remembered correctly

This commit is contained in:
Christophe Dumez 2010-06-23 15:14:38 +00:00
parent 762962270c
commit cf65e4d77d
3 changed files with 26 additions and 9 deletions

View file

@ -1065,6 +1065,21 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
}
return h;
}
// Check number of files
if(t->num_files() < 1) {
addConsoleMessage(tr("Error: The torrent %1 does not contain any file.").arg(misc::toQStringU(t->name())));
if(fromScanDir) {
// Delete torrent from scan dir
QFile::remove(file);
} else {
if(!from_url.isNull()) {
// If download from url, remove temp file
QFile::remove(file);
}
}
return h;
}
// Actually add the torrent
QString root_folder = misc::truncateRootFolder(t);
add_torrent_params p;
//Getting fast resume data if existing