From 9546a73182597486a3cf47acdf1de1a3b249e822 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 18 Sep 2012 20:01:59 +0300 Subject: [PATCH] Fix torrent temporary path functionality --- src/qtlibtorrent/qbtsession.cpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index e83fd9e9a..d5ad74d81 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -930,7 +930,7 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed, bool f } if (savePath.isEmpty()) savePath = getSavePath(hash, false); - if (!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash) && !resumed) { + if (!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash)) { qDebug("addMagnetURI: Temp folder is enabled."); QString torrent_tmp_path = defaultTempPath.replace("\\", "/"); p.save_path = torrent_tmp_path.toUtf8().constData(); @@ -961,12 +961,6 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed, bool f } Q_ASSERT(h.hash() == hash); - // If temp path is enabled, move torrent - if (!defaultTempPath.isEmpty() && !resumed) { - qDebug("Temp folder is enabled, moving new torrent to temp folder"); - h.move_storage(defaultTempPath); - } - loadTorrentSettings(h); // Load filtered files @@ -1119,7 +1113,7 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr } else { savePath = getSavePath(hash, fromScanDir, path); } - if (!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash) && !resumed) { + if (!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash)) { qDebug("addTorrent::Temp folder is enabled."); QString torrent_tmp_path = defaultTempPath.replace("\\", "/"); p.save_path = torrent_tmp_path.toUtf8().constData(); @@ -1147,19 +1141,6 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr return h; } - // If temp path is enabled, move torrent - // 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"); - QString torrent_tmp_path = defaultTempPath.replace("\\", "/"); - if (!root_folder.isEmpty()) { - if (!torrent_tmp_path.endsWith("/")) torrent_tmp_path += "/"; - torrent_tmp_path += root_folder; - } - h.move_storage(torrent_tmp_path); - }*/ - loadTorrentSettings(h); if (!resumed) {