From de04b47c2958eb911773c0a6cf265c7d5a8b6db4 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 17 Oct 2010 14:53:03 +0000 Subject: [PATCH] BUGFIX: Fix detection of files at final destination when temp dir is used --- Changelog | 1 + src/bittorrent.cpp | 20 ++++++-------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/Changelog b/Changelog index 0ead1bcb6..432f44bd8 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,7 @@ * Unreleased - Christophe Dumez - v2.4.6 - BUGFIX: Fix "torrent seeding after creation" feature - BUGFIX: The properties panel data would sometimes not match the selected torrent + - BUGFIX: Fix detection of files at final destination when temp dir is used * Tue Oct 12 2010 - Christophe Dumez - v2.4.5 - BUGFIX: Remember torrent completion date correctly diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index d13a6f00c..4f0cfdafc 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -864,11 +864,7 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) { } QString torrent_name = misc::magnetUriToName(magnet_uri); const QString savePath(getSavePath(hash, false, QString::null, torrent_name)); - if(!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash) -#if LIBTORRENT_VERSION_MINOR > 14 - && !TorrentTempData::isSeedingMode(hash) -#endif - ) { + if(!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash) && resumed) { qDebug("addMagnetURI: Temp folder is enabled."); qDebug("addTorrent::Temp folder is enabled."); QString torrent_tmp_path = defaultTempPath.replace("\\", "/"); @@ -917,10 +913,10 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) { Q_ASSERT(h.hash() == hash); // If temp path is enabled, move torrent - /*if(!defaultTempPath.isEmpty() && !resumed) { + if(!defaultTempPath.isEmpty() && !resumed) { qDebug("Temp folder is enabled, moving new torrent to temp folder"); h.move_storage(defaultTempPath); - }*/ + } // Connections limit per torrent h.set_max_connections(Preferences::getMaxConnecsPerTorrent()); @@ -1120,11 +1116,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr } else { savePath = getSavePath(hash, fromScanDir, path, root_folder); } - if(!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash) -#if LIBTORRENT_VERSION_MINOR > 14 - && !TorrentTempData::isSeedingMode(hash) -#endif - ) { + if(!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash) && resumed) { qDebug("addTorrent::Temp folder is enabled."); QString torrent_tmp_path = defaultTempPath.replace("\\", "/"); if(!root_folder.isEmpty()) { @@ -1180,7 +1172,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr TorrentPersistentData::setRootFolder(hash, root_folder); // If temp path is enabled, move torrent - /*if(!defaultTempPath.isEmpty() && !resumed) { + if(!defaultTempPath.isEmpty() && !resumed) { qDebug("Temp folder is enabled, moving new torrent to temp folder"); QString torrent_tmp_path = defaultTempPath.replace("\\", "/"); if(!root_folder.isEmpty()) { @@ -1188,7 +1180,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr torrent_tmp_path += root_folder; } h.move_storage(torrent_tmp_path); - }*/ + } // Connections limit per torrent h.set_max_connections(Preferences::getMaxConnecsPerTorrent());