From 6744ee8a4dff66cf4021c8d0970cede019f3c10c Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 1 Dec 2010 19:20:27 +0000 Subject: [PATCH] BUGFIX: Improve magnet save path handling (clsoes #683395) --- Changelog | 1 + src/qtlibtorrent/qbtsession.cpp | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Changelog b/Changelog index 147affba8..be67914e4 100644 --- a/Changelog +++ b/Changelog @@ -18,6 +18,7 @@ - BUGFIX: Fix two advanced settings (ignore limits on LAN and protocol overhead inclusion in rate limiter) - BUGFIX: Fix strict super seeding (was not working) + - BUGFIX: Improve magnet save path handling (clsoes #683395) - COSMETIC: Replaced message box by on-screen notification for download errors - COSMETIC: Improved the torrent creation tool appearance - COSMETIC: Use country flags by Mark James (Thanks to Dmytro Pukha) diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index fc1e71051..c3e0bf11e 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -855,8 +855,7 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed) { add_torrent_params p = initializeAddTorrentParams(hash); // Get save path - QString torrent_name = misc::magnetUriToName(magnet_uri); - const QString savePath(getSavePath(hash, false, QString::null, torrent_name)); + const QString savePath(getSavePath(hash, false)); if(!defaultTempPath.isEmpty() && !TorrentPersistentData::isSeed(hash) && resumed) { qDebug("addMagnetURI: Temp folder is enabled."); QString torrent_tmp_path = defaultTempPath.replace("\\", "/"); @@ -2173,10 +2172,8 @@ void QBtSession::readAlerts() { torrent_tmp_path += root_folder; h.move_storage(torrent_tmp_path); } else { - QString save_path = h.save_path().replace("\\", "/"); - if(!save_path.endsWith("/")) save_path += "/"; - save_path += root_folder; - h.move_storage(save_path); + QString save_path = h.save_path(); + h.move_storage(QDir(save_path).absoluteFilePath(root_folder)); } } emit metadataReceived(h);