BUGFIX: Fix directory scanning (stop trying to download the same files several times)

This commit is contained in:
Christophe Dumez 2007-02-24 18:36:15 +00:00
parent 17d880189f
commit fb9c1938ea
2 changed files with 5 additions and 5 deletions

View file

@ -1303,11 +1303,6 @@ void GUI::addTorrent(const QString& path, bool fromScanDir, const QString& from_
if(scan_dir.at(scan_dir.length()-1) != QDir::separator()){
scan_dir += QDir::separator();
}
//rename torrent file to match file name and find it easily later
dest_file = scan_dir+hash.toUtf8()+".torrent";
if(!QFile::exists(dest_file)){
QFile::rename(file, dest_file);
}
}
// Adding torrent to download list
DLListModel->insertRow(row);
@ -1342,6 +1337,10 @@ void GUI::addTorrent(const QString& path, bool fromScanDir, const QString& from_
// remove temporary file
QFile::remove(file);
}
// Delete from scan dir to avoid trying to download it again
if(fromScanDir){
QFile::remove(file);
}
// Update info Bar
if(!fastResume){
if(!from_url.isNull()){