BUGFIX: Make sure we don't move completed torrent to the temp directory for checking (closes #602938)

This commit is contained in:
Christophe Dumez
2010-12-11 19:32:13 +00:00
parent d5bf2b2e1f
commit 6a38f69fad
2 changed files with 7 additions and 2 deletions

View File

@@ -2,6 +2,8 @@
- BUGFIX: Fix alternative speed icon staying pressed when disabled - BUGFIX: Fix alternative speed icon staying pressed when disabled
- BUGFIX: Fix slot warning on startup - BUGFIX: Fix slot warning on startup
- BUGFIX: Fix alignment issues in program preferences - BUGFIX: Fix alignment issues in program preferences
- BUGFIX: Make sure we don't move completed torrent to the temp directory
for checking (closes #602938)
* Sun Dec 5 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.5.1 * Sun Dec 5 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.5.1
- BUGFIX: Fix possible crash when right-clicking on a torrent - BUGFIX: Fix possible crash when right-clicking on a torrent

View File

@@ -1045,7 +1045,9 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
TorrentPersistentData::setRootFolder(hash, root_folder); TorrentPersistentData::setRootFolder(hash, root_folder);
// If temp path is enabled, move torrent // If temp path is enabled, move torrent
if(!defaultTempPath.isEmpty() && !resumed) { // XXX: The torrent is moved after the torrent_checked_alert
// is received to make sure we don't move a completed torrent (#602938)
/*if(!defaultTempPath.isEmpty() && !resumed) {
qDebug("Temp folder is enabled, moving new torrent to temp folder"); qDebug("Temp folder is enabled, moving new torrent to temp folder");
QString torrent_tmp_path = defaultTempPath.replace("\\", "/"); QString torrent_tmp_path = defaultTempPath.replace("\\", "/");
if(!root_folder.isEmpty()) { if(!root_folder.isEmpty()) {
@@ -1053,7 +1055,7 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
torrent_tmp_path += root_folder; torrent_tmp_path += root_folder;
} }
h.move_storage(torrent_tmp_path); h.move_storage(torrent_tmp_path);
} }*/
loadTorrentSettings(h); loadTorrentSettings(h);
@@ -2332,6 +2334,7 @@ void QBtSession::readAlerts() {
const QDir current_dir(h.save_path()); const QDir current_dir(h.save_path());
const QDir save_dir(getSavePath(h.hash())); const QDir save_dir(getSavePath(h.hash()));
if(current_dir == save_dir) { if(current_dir == save_dir) {
qDebug("Moving the torrent to the temp directory...");
QString root_folder = TorrentPersistentData::getRootFolder(hash); QString root_folder = TorrentPersistentData::getRootFolder(hash);
QString torrent_tmp_path = defaultTempPath.replace("\\", "/"); QString torrent_tmp_path = defaultTempPath.replace("\\", "/");
if(!root_folder.isEmpty()) { if(!root_folder.isEmpty()) {